This is text chat, not every feature of a familiar SDK
The current contract accepts system, user and assistant text messages, with up to 32 messages and 12 KB of combined message text. It does not support tools, image attachments or streaming. Use the live catalog for availability and preserve the model's exact gateway alias rather than substituting another similarly named product.
What to do next
- 01
Prepare a bounded conversation
Include the user's actual question and only the context needed to answer it. Choose max_tokens from 1 to 4096; the default is 256 if omitted.
- 02
Approve the reservation
Request a quote and review the maximum credit reservation. The final confirmed charge is based on measured input and output tokens, so the initial estimate is not necessarily the final debit.
- 03
Handle both response branches
For a completion, read choices and usage plus the AISwapLab receipt. For a 202 job, save its ID and follow the recovery path instead of sending another paid chat request.
A concrete example
Illustrative body: one user asks for a short scene description, with max_tokens 256, stream false and an approved max_credits. This is a contract example and does not establish response quality or latency.
Illustrative non-streaming chat body
Illustrative integration code. No paid generation was executed for this guide. Review live availability, quotes and your own approval before running creation requests.
{
"model": "deepseek-v4.1-flash",
"messages": [
{
"role": "user",
"content": "Write one concise description of a calm coastal scene."
}
],
"max_tokens": 256,
"stream": false,
"max_credits": 10
}Before you call it ready
- At least one user message is present.
- The request is non-streaming.
- Completion and uncertain-job responses are both supported.
When to stop or choose another method
If your application requires multimodal input, tool execution or token streaming, do not pretend those features are enabled. Adapt the product or choose a supported route.
