Skip to content

How do I send a DeepSeek text request through AISwapLab?

POST to /api/v1/chat/completions with model=deepseek-v4.1-flash, a messages array containing a user message, max_credits and a persisted Idempotency-Key. Set stream=false and choose an appropriate max_tokens value. Quote the same body first. The route returns a confirmed completion when available, or a durable job when the outcome is uncertain.

BUILD NON-STREAMING TEXT WORKFLOWSAISwapLab team · Editorial methodUpdated 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Prepare a bounded conversation; Approve the reservation; Handle both response branches.
Workflow diagram: Prepare a bounded conversation → Approve the reservation → Handle both response branches. Read the article for evidence and limits.

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

  1. 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.

  2. 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.

  3. 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.

json
{
  "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.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation