canonical: https://jentic.com/apis/deepseek.com/deepseek

# DeepSeek API

Jentic maintains a curated, agent-optimized OpenAPI specification for DeepSeek API, keeping it validated and agent-ready. DeepSeek provides access to its family of large language models through an OpenAI-compatible chat completions interface, making it straightforward to swap into existing tooling. The API exposes chat completions, model listings, and account balance lookups so agents can generate responses, choose between available DeepSeek models, and monitor remaining credit. Authentication uses Bearer tokens and the surface is intentionally small, with three endpoints covering inference and account state.

## For AI agents

Generate chat completions with DeepSeek language models using an OpenAI-compatible request format, list available models, and check account balance.

## Scope

Does not handle image generation, audio transcription, fine-tuning, or embeddings - use for DeepSeek chat completions and account state only.

## Capabilities

- Generate chat completions from prompts using DeepSeek models via POST `/chat/completions`
- List the DeepSeek models available to the calling account through GET /models
- Check remaining account balance and granted credit with GET `/user/balance`
- Stream multi-turn assistant responses by reusing the OpenAI-compatible message format
- Select between DeepSeek model variants when issuing a chat completion request

## Use cases

### OpenAI-Compatible Chat Completions

Drop DeepSeek into an existing OpenAI-compatible client by pointing the base URL at api.deepseek.com and supplying a Bearer token. The `/chat/completions` endpoint accepts the same message and parameter shape, allowing teams to evaluate DeepSeek outputs against other providers without rewriting their inference layer. This is the fastest way to A/B test model quality and pricing.

Example prompt: Send a chat completion request to `/chat/completions` with a system prompt and user message, then return the assistant content.

### Model Selection and Discovery

Before issuing a chat completion, an agent or developer can call /models to see which DeepSeek model identifiers the account has access to. This avoids hard-coded model names that drift over time and lets agents pick the most appropriate model at runtime. The list is small and stable, suitable for caching for short windows.

Example prompt: Call GET /models, parse the returned model list, and select the first chat-capable model id for the next completion.

### Account Balance Monitoring

DeepSeek exposes `/user/balance` so applications can check remaining credit before issuing expensive completions. This lets agents and dashboards flag low balances, pause non-essential calls, or trigger top-ups. The endpoint returns granted, topped-up, and total balance figures suitable for billing alerts.

Example prompt: Call GET `/user/balance` and emit a warning if the total balance falls below a configured threshold.

### AI Agent Integration via Jentic

Through Jentic, an agent finds DeepSeek by searching for an inference intent rather than reading docs. Jentic returns the matching operation schema for `/chat/completions`, the agent fills in the messages, and the call executes with the API key resolved from your Jentic One instance. Swapping providers becomes a search query change, not a rewrite.

Example prompt: Use Jentic to search for 'generate text with DeepSeek', load the chat completions schema, and execute a request with a user prompt.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/chat/completions` | Create a chat completion |
| GET | `/models` | List available DeepSeek models |
| GET | `/user/balance` | Get remaining account balance |

## Key resources

- **Chat** — Generate chat completions from a list of messages using a DeepSeek model
- **Models** — List the DeepSeek model identifiers available to the account
- **User** — Account-level operations including balance lookup

## Why Jentic

- **Setup:** Wiring the DeepSeek API by hand means learning its bearer auth, passing the API key as a Bearer token, and mapping chat completions alongside the models and balance reads. Through Jentic you install once, import the DeepSeek API from the API Directory, store the API key once, and your agent calls it.
- **Permission scoping:** DeepSeek carries the prompt and model in the request body rather than as a resource id in the URL path, so limit the agent to the operations it needs, such as generating a chat completion or listing models. Because you pick the operations, the account balance read is included only if you add it.
- **Credential handling:** Your DeepSeek API key is stored once, encrypted, by your own Jentic One instance and applied as the Bearer token at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'generate a chat completion', and Jentic returns the DeepSeek `/chat/completions` operation with its full input schema so the agent calls the right endpoint without reading docs.

## Related APIs

- **OpenAI API** — OpenAI's GPT models with the same chat completions request shape DeepSeek mirrors.
- **Anthropic API** — Claude family models with a separate messages format and longer context windows.
- **Groq API** — Low-latency inference for open-weight models served on Groq's LPU hardware.
- **Mistral AI API** — European LLM provider with comparable chat completions surface and embeddings.

## FAQ

### Which OpenAPI specification does this DeepSeek API page describe?

A curated, agent-optimized Jentic specification covering 3 DeepSeek operations, validated against the live API and kept up to date. DeepSeek's own API reference docs at https://api-docs.deepseek.com/api/deepseek-api are generated from an OpenAPI document DeepSeek maintains internally, which those pages report as version 1.0.0 with HTTP Bearer auth. DeepSeek serves the rendered reference rather than the source file, so there is no vendor URL to fetch it from. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the DeepSeek API use?

The DeepSeek API uses HTTP Bearer token authentication. Pass your DeepSeek API key in the Authorization header as `Authorization: Bearer <key>`. Through Jentic, the key is stored in the encrypted vault and never enters the agent's context window.

### Can I use the DeepSeek API as a drop-in for OpenAI?

Yes. The `/chat/completions` endpoint accepts the same messages array and parameters as the OpenAI chat completions API, so most OpenAI client libraries work by changing the base URL to https://api.deepseek.com and supplying a DeepSeek Bearer key.

### How do I list the DeepSeek models my account can use?

Call GET /models with your Bearer token. The response contains the DeepSeek model identifiers available for chat completion requests, which you then pass as the `model` field on POST `/chat/completions.`

### How do I check my remaining DeepSeek balance?

Call GET `/user/balance.` The endpoint returns granted credit, topped-up credit, and total remaining balance, which agents can use to gate expensive inference calls.

### How do I generate a DeepSeek chat completion through Jentic?

Run `pip install jentic`, then search for 'generate text with DeepSeek', load the `/chat/completions` operation, and execute with your messages payload. Jentic resolves the Bearer token from the vault at execution time.

### Can I limit what my agent is allowed to do with the DeepSeek API?

Yes. Because Jentic One is self-hosted, you decide which DeepSeek operations your agent may call, so you can allow it to generate chat completions with POST `/chat/completions` and list models with GET /models while withholding the account balance read at GET `/user/balance.` DeepSeek carries the prompt and model choice in the request body rather than as a resource id in the URL, so scoping is done at the operation level by only importing the endpoints the agent needs. Your DeepSeek API key stays stored by your own instance and is applied at execution time, never entering the agent's prompt or logs.
