# DeepSeek — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API |
> |---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Frontier AI models — DeepSeek-V3 for fast chat and code, DeepSeek-R1 for deep chain-of-thought reasoning. OpenAI-compatible API format. Among the most capable and cost-efficient models available.

**Category:** AI / LLM | **Website:** [deepseek.com](https://deepseek.com) | **Docs:** [api-docs.deepseek.com](https://api-docs.deepseek.com)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/deepseek/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

> Also available via public x402 on Base (no account needed): [x402/deepseek.md](https://beta.paywithlocus.com/x402/deepseek.md)

> Also available via MPP (no account needed): [mpp/deepseek.md](https://beta.paywithlocus.com/mpp/deepseek.md)

## Endpoints

### Chat

Create a chat completion using DeepSeek V4 Flash or V4 Pro, with optional thinking mode. OpenAI-compatible request/response format.

**Estimated cost:** Usage-based; the 402 challenge advertises the authorization maximum

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Metered x402 model: deepseek-v4-flash or deepseek-v4-pro |
| `messages` | array | Yes | Array of message objects: [{"role":"system"\|"user"\|"assistant","content":"..."}] |
| `max_tokens` | number | Yes | Maximum tokens to generate (up to 384000). Required to bound metered x402 authorization. |
| `temperature` | number | No | Sampling temperature 0–2. Default: 1. Lower = more deterministic. |
| `stream` | boolean | No | Streaming is not currently supported through public x402. Omit or use false. |
| `top_p` | number | No | Nucleus sampling parameter. Default: 1. |
| `stop` | string | No | Stop sequence(s) — string or array of strings. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/deepseek/chat \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<string>","messages":"<array>","max_tokens":"<number>","temperature":"<number>","stream":"<boolean>","top_p":"<number>","stop":"<string>"}'
```

### Fill-In-the-Middle (FIM)

Code completion with fill-in-the-middle — provide a code prefix and optional suffix, and DeepSeek fills in the middle. Ideal for copilot-style code generation. Metered x402 supports deepseek-v4-pro.

**Estimated cost:** Usage-based; the 402 challenge advertises the authorization maximum

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Must be deepseek-v4-pro for metered x402 FIM |
| `prompt` | string | Yes | The code prefix to complete |
| `suffix` | string | No | The code suffix (text after the cursor). DeepSeek fills between prompt and suffix. |
| `max_tokens` | number | Yes | Maximum tokens to generate (up to 384000). Required to bound metered x402 authorization. |
| `temperature` | number | No | Sampling temperature. Default: 1. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/deepseek/fim \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<string>","prompt":"<string>","suffix":"<string>","max_tokens":"<number>","temperature":"<number>"}'
```

### List Models

List available DeepSeek models with owner and availability information.

**Estimated cost:** $0.003 fee only

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/deepseek/list-models \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
