Views
No views yet
deepseek-chat (optimized for standard turn-based chat, lower latency) and deepseek-reasoner (a “thinking” mode that prioritizes chain-of-thought and structured reasoning).Deepseek V3.1 API from CometAPI\**deepseek v3.1\** API Pricing in CometAPI,20% off the official price:| Input Tokens | $0.44 |
|---|---|
| Output Tokens | $1.32 |
deepseek-v3.1“ / “deepseek-v3-1-250821” endpoint to send the API request and set the request body. The request method and request body are obtained from our website API doc. Our website also provides Apifox test for your convenience.prompt, max_tokens_to_sample, temperature, stop_sequenceshttps://api.cometapi.com/v1/chat/completionsdeepseek-v3.1“ / “deepseek-v3-1-250821“ Bearer YOUR_CometAPI_API_KEYapplication/json .ReplaceCometAPI_API_KEYwith your key; note the base URL.
from openai import OpenAI
client = OpenAI(
api_key=os.environ["CometAPI_API_KEY"],
base_url="https://api.cometapi.com/v1/chat/completions" # important
)
resp = client.chat.completions.create(
model="deepseek-v3.1",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Summarize this PDF in 5 bullets."}
],
temperature=0.3,
response_format={"type": "json_object"} # for structured outputs
)
print(resp.choices[0].message.content)