| Input | $1/百万 tokens |
| Cached writes(5m) | $4/百万 tokens |
| Cached reads | $3/百万 tokens |
| Output | $2/百万 tokens |
| Request the length each time | Input | Cached writes(5m) | Cached reads | Selling price |
|---|---|---|---|---|
| 0 < tokens <= 20,000 | $1.1 | $4.1 | $3.1 | $2.1 |
| 20,000 < tokens <= 32,000 | $1.2 | $4.2 | $3.2 | $2.2 |
| 32,000 < tokens <= 65,555 | $1.3 | $4.3 | $3.3 | $2.3 |
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",
10 messages=[
11 {"role": "system", "content": "You are a helpful assistant."},
12 {"role": "user", "content": "Hello, how are you?"}
13 ],
14 max_tokens=65555,
15 temperature=0.7
16)
17
18print(response.choices[0].message.content)