Documentation

Text API guide

Use DeepSeek V4.1 Flash through an OpenAI-compatible API. Choose fast for interactive work or slow when lower token costs matter more than response speed. Both use the same API keys, endpoint, and account balance.

Make your first request

  1. Create an account, add credit, and create an API key on the dashboard.
  2. Store the key as LUMINAL_API_KEY in your environment. Keys are shown once; keep them out of browser code and source control.
  3. Send a request to https://flash.luminal.cloud/v1/chat/completions.
curl https://flash.luminal.cloud/v1/chat/completions \
  -H "Authorization: Bearer $LUMINAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-slow",
    "messages": [{"role": "user", "content": "Explain how a rainbow forms."}],
    "max_tokens": 2048,
    "stream": true
  }'

For an OpenAI SDK, set the base URL to https://flash.luminal.cloud/v1, pass your Luminal key, and use one of the model IDs below. Set stream: true to receive server-sent events, or omit it for a single JSON response. Streamed responses contain OpenAI-compatible chunks and finish with [DONE].

Models and pricing

USD per million tokens. Reasoning tokens are included in billed output.

Default fast and slow model token prices
Model IDInputCached inputOutput
deepseek-fast$0.4275$0.0087$1.7100
deepseek-slow$0.0700$0.0014$0.1400

These rates are the same at every hour. Explicit customer-specific rate cards take precedence. The classic deepseek-ai/DeepSeek-V4.1-Flash model remains available at its own rates; changing to fast or slow requires changing the model field. See all pricing.

List models available to your key with GET /v1/models using bearer authentication. An unrestricted key can use the public fast and slow models. A key with a model allowlist must include the exact requested model ID; allowing the classic model alone does not grant fast or slow.

Caching, usage, and billing

Repeated prompt prefixes, such as the system prompt and earlier turns, can receive the cached-input rate. Keep reusable prefixes consistent. The response's usage.prompt_tokens_details.cached_tokens reports cached input; the remaining prompt tokens use the uncached rate. Completion tokens, including reasoning, use the output rate.

The model may reason before producing visible text. Allow enough output tokens for both; a very small max_tokens can finish before a visible answer. When omitted, the default output allowance is 65,536 tokens. API usage and actual charges are shown in the dashboard. GET /v1/balance returns your balance using the same bearer key.

Use streaming for long answers. Dedicated fast/slow requests do not automatically fall back to a different model. If a stream fails after it begins, handle the incomplete answer explicitly; do not treat a partial response as a completed result.

Default limits

  • Shared account cap: 80 requests/minute across text models and all keys belonging to that account.
  • Model buckets: 25 RPM fast and 45 RPM slow, also shared across the account's keys.
  • Surge limit: 10 requests/second. There is no default token-per-minute cap.

All applicable limits are enforced together: up to 25 fast requests/minute and 45 slow requests/minute, within the shared 80 RPM budget. Requests to the classic model also use that shared budget. Custom account/model limits can differ.

Limits use token buckets, allowing bursts rather than a strict calendar-minute reset. Model capacity can also cause rejection before an RPM limit is reached. Follow the response's Retry-After header. Contact [email protected] for higher limits.

Errors and retries

400
Invalid request or unsupported model/media. Check the error code and request fields.
401
Missing, invalid, or revoked API key.
402
Insufficient prepaid credit. Add credit from the dashboard.
403
The account or API key is not permitted to use this model.
413
The request or its images exceed the model's size limits.
429
An account or model limit was reached. Wait for Retry-After before retrying.
502 / 503 / 504
An upstream, capacity, or timeout error. Honor Retry-After when present and use bounded retries.

Read the JSON error code as well as the HTTP status. Retry transient failures with backoff; fix authentication, credit, or request errors before retrying.

Release notes · All pricing · Contact support