Deepseek V3.1 Chat
Advanced AI reasoning powered by Deepseek V3.1 - optimized for coding, math, and complex problem-solving
Backend online
0 characters
•
Input 0.40 /M tokens • Output 2.0 /M tokens
🔌 API Access
Connect to Deepseek V3.1 via our streaming REST endpoint.
🔑 API Keys
Include an active API key with every request. Manage your API keys →
POST
/api/v1/generate
Chat with Deepseek V3.1
Send structured conversations for Deepseek V3.1 to solve complex reasoning and coding tasks.
Two options for API calls:
- Non-streaming:
/api/v1/generatewith JSON body (recommended for complete responses) - Streaming:
/api/v1/generate/streamwith"stream": true(real-time responses) - Alternative:
/api/v1/generate/streamwith"stream": false(equivalent to /api/v1/generate)
Cost:
0.40 credits / 1M input tokens • 2.0 credits / 1M output tokens
Request (cURL) - Non-Streaming
curl -X POST https://app.eigenai.com/api/v1/generate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "deepseek-v31-terminus",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Let N be the number of positive integers less than 1000 that are divisible by 3 or 7 but not by 21. What is the value of N?"}
],
"max_tokens": 4096,
"chat_template_kwargs": {
"thinking": true
},
"temperature": 0,
"top_p": 0.95,
"top_k": 1
}'
Request (Python)
import json
import requests
url = "https://app.eigenai.com/api/v1/generate"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"model": "deepseek-v31-terminus",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Let N be the number of positive integers less than 1000 that are divisible by 3 or 7 but not by 21. What is the value of N?"}
],
"max_tokens": 4096,
"chat_template_kwargs": {
"thinking": True
},
"temperature": 0,
"top_p": 0.95,
"top_k": 1
}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))
Request (JavaScript/Node.js)
import fetch from 'node-fetch';
const payload = {
model: 'deepseek-v31-terminus',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Let N be the number of positive integers less than 1000 that are divisible by 3 or 7 but not by 21. What is the value of N?' }
],
max_tokens: 4096,
chat_template_kwargs: {
thinking: true
},
temperature: 0,
top_p: 0.95,
top_k: 1
};
const response = await fetch('https://app.eigenai.com/api/v1/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status} ${await response.text()}`);
}
const result = await response.json();
console.log(result);
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model |
string | ✅ Yes | Use deepseek-v31-terminus for the latest reasoning model |
messages |
array | ✅ Yes | Conversation history with {role, content} objects |
max_tokens |
number | Optional | Maximum response tokens (default 4096) |
chat_template_kwargs.thinking |
boolean | Optional | Set to true to request chain-of-thought output |
reasoning_effort |
string | Optional | Controls the amount of reasoning (low, medium, high) |
separate_reasoning |
boolean | Optional | Emit structured reasoning separately from final answer |
temperature |
number | Optional | Creativity/variance (0-2, default 0.7; use 0 for deterministic reasoning) |
top_p |
number | Optional | Nucleus sampling probability mass (set to 1 for full distribution) |
top_k |
number | Optional | Limits candidates to the top-k tokens (set to 1 for greedy decoding) |