# DeepSeek V4 API (reAPI)

## Overview

- What it does: DeepSeek V4 API — Flash and Pro open-weight models on one OpenAI-compatible /api/v1/chat/completions endpoint on reapi.ai. 1M context, 384K max output, thinking mode by default, vision input, and tool use.
- Vendor: DeepSeek
- Category: chat
- Wire model id: `deepseek-v4-flash`
- Endpoint: `POST https://api.reapi.ai/v1/chat/completions` (Bearer auth; synchronous, OpenAI-compatible — no task polling)
- Landing page: https://reapi.ai/models/deepseek-v4
- API key: create one at https://reapi.ai/settings/apikeys and send it as `Authorization: Bearer YOUR_API_KEY`

## Group pricing: deepseek-v4-flash

Current reAPI group prices from the same snapshot as the model page, in USD per 1 million tokens.
Default group: deepseek.

| Group | Model ID | Token type | USD per 1M tokens |
| --- | --- | --- | ---: |
| deepseek | deepseek-v4-flash | input | $0.18 |
| deepseek | deepseek-v4-flash | output | $0.72 |
| deepseek | deepseek-v4-flash | cacheRead | $0.0036 |
| deepseek | deepseek-v4-flash | cacheWrite | $0.18 |


## Group pricing: deepseek-v4-pro

Current reAPI group prices from the same snapshot as the model page, in USD per 1 million tokens.
Default group: deepseek.

| Group | Model ID | Token type | USD per 1M tokens |
| --- | --- | --- | ---: |
| deepseek | deepseek-v4-pro | input | $0.792 |
| deepseek | deepseek-v4-pro | output | $2.376 |
| deepseek | deepseek-v4-pro | cacheRead | $0.0264 |
| deepseek | deepseek-v4-pro | cacheWrite | $0.792 |


## Pricing

The summary prices below use each model’s default group listed above.

Current reAPI prices from the same quote as the model page, in USD. 1 credit = $0.001. Successful delivered requests are settled from actual usage/cost; no per-request whole-credit rounding is applied to token prices. No task polling or automatic retry is required.
- reAPI price quote fetched at: 2026-12-01T06:04:24.045Z (UTC).
- Price refresh interval: 300 seconds. Fetch this URL again after the cache expires to obtain updated prices and discounts.

- flash / inputMiss: $0.18 per 1M tokens
- flash / inputHit: $0.0036 per 1M tokens
- flash / output: $0.72 per 1M tokens
- pro / inputMiss: $0.792 per 1M tokens
- pro / inputHit: $0.0264 per 1M tokens
- pro / output: $2.376 per 1M tokens
- flash / cacheWrite: $0.18 per 1M tokens
- pro / cacheWrite: $0.792 per 1M tokens

## Calling this model

Synchronous and OpenAI-compatible: point any OpenAI SDK at the base URL below and use the wire model id. Responses return in the same HTTP call — there is no task id and nothing to poll.

- Base URL: `https://api.reapi.ai/v1`

## Input schema

Kept 1:1 with the live request validator; constraints are enforced server-side too. All media inputs are public HTTP(S) URLs — base64 and `data:` URIs are rejected platform-wide.

- `messages` (string, required) — OpenAI-style chat message array
- `stream` (boolean, optional, default false) — Stream the response as server-sent events
- `temperature` (string, optional, default "1")
- `top_p` (string, optional, default "1")
- `max_tokens` (string, optional, default "4096") — Upper bound on generated tokens
- `frequency_penalty` (string, optional, default "0")
- `presence_penalty` (string, optional, default "0")

## Example request

```json
{
  "model": "deepseek-v4-flash",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ],
  "stream": true,
  "max_tokens": 4096,
  "temperature": 0.7
}
```

## Usage examples

### cURL

```bash
curl https://api.reapi.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [
      { "role": "user", "content": "Hello" }
    ],
    "stream": true,
    "max_tokens": 4096,
    "temperature": 0.7
  }'
```

### Python (OpenAI SDK)

```python
from openai import OpenAI

client = OpenAI(base_url="https://api.reapi.ai/v1", api_key="YOUR_API_KEY")
response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
```

### JavaScript (OpenAI SDK)

```javascript
import OpenAI from 'openai';

const client = new OpenAI({ baseURL: 'https://api.reapi.ai/v1', apiKey: 'YOUR_API_KEY' });
const response = await client.chat.completions.create({
  model: 'deepseek-v4-flash',
  messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);
```

## Other agent-readable surfaces

This file covers one model. To find anything else:

- Full API reference (markdown, incl. task-type constraints and error semantics): https://reapi.ai/docs/deepseek-v4.md
- Platform index: https://reapi.ai/llms.txt
- Machine-readable API spec (OpenAPI): https://api.reapi.ai/openapi.json · agent skills index: https://reapi.ai/.well-known/agent-skills/index.json
- Authentication guide: https://reapi.ai/auth.md
- Full documentation and blog as one file: https://reapi.ai/llms-full.txt
- Any other model: `https://reapi.ai/models/<slug>/llms.txt` — every model page serves this same agent-readable form.
