| Input | $5/百万 tokens |
| Cached writes(5m) | $8/百万 tokens |
| Cached reads | $7/百万 tokens |
| Output | $6/百万 tokens |
| Request the length each time | Input | Cached writes(5m) | Cached reads | Selling price |
|---|---|---|---|---|
| 0 < tokens <= 32,000 | $5.1 | $8.1 | $7.1 | $6.1 |
| 32,000 < tokens <= 128,000 | $5.3 | $8.3 | $7.3 | $6.3 |
| 128,000 < tokens <= 256,000 | $5.2 | $8.2 | $7.2 | $6.2 |
Use the following code example to integrate our API:
1from openai import OpenAI
2
3client = OpenAI(
4 api_key="<Your API Key>",
5 base_url="https://api.jiekou.ai/openai"
6)
7
8response = client.chat.completions.create(
9 model="test-model-jiekou-2",
10 messages=[
11 {"role": "system", "content": "You are a helpful assistant."},
12 {"role": "user", "content": "Hello, how are you?"}
13 ],
14 max_tokens=65000,
15 temperature=0.7
16)
17
18print(response.choices[0].message.content)