Docs

Point any OpenAI-compatible tool at https://api.affordableai.eu/v1. One URL change, everything else stays the same.

Base URL: https://api.affordableai.eu/v1 · Model: deepseek-ai/DeepSeek-V4-Flash · Auth: Bearer YOUR_API_KEY
One model, any name. We serve a single model, so whatever model value your tool sends — even "default" — routes to deepseek-ai/DeepSeek-V4-Flash. Zero model config required.

OpenAI SDK

# Install
pip install openai

# Use
from openai import OpenAI
client = OpenAI(
    base_url="https://api.affordableai.eu/v1",
    api_key="YOUR_API_KEY",
)
response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Flash",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

Claude Code

Claude Code speaks the Anthropic API, and we serve it. Map every model slot to our model so each Claude Code feature (main, fast tasks, sub-agents) routes to your GPU:

# point Claude Code at AffordableAI
export ANTHROPIC_BASE_URL="https://api.affordableai.eu"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
export ANTHROPIC_MODEL="deepseek-ai/DeepSeek-V4-Flash"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-ai/DeepSeek-V4-Flash"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-ai/DeepSeek-V4-Flash"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-ai/DeepSeek-V4-Flash"
export CLAUDE_CODE_SUBAGENT_MODEL="deepseek-ai/DeepSeek-V4-Flash"

# third-party endpoint: skip Anthropic-only beta headers + telemetry
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1

# now just run it — single & multi-turn, reasoning, and tools all work
claude

Cursor

1. Open Cursor Settings -> Models
2. Add model: deepseek-ai/DeepSeek-V4-Flash
3. Base URL: https://api.affordableai.eu/v1
4. API Key: YOUR_API_KEY
5. Select as default

Continue (VS Code / JetBrains)

{
  "models": [{
    "title": "DeepSeek V4 Flash",
    "provider": "openai",
    "model": "deepseek-ai/DeepSeek-V4-Flash",
    "apiBase": "https://api.affordableai.eu/v1",
    "apiKey": "YOUR_API_KEY"
  }]
}

aider

# .aider.conf.yml or command line
aider --model openai/deepseek-ai/DeepSeek-V4-Flash \
      --openai-api-base https://api.affordableai.eu/v1 \
      --openai-api-key YOUR_API_KEY

To turn on reasoning, declare the model in ~/.aider.model.settings.yml, then pass --reasoning-effort low:

- name: openai/deepseek-ai/DeepSeek-V4-Flash
  accepts_settings:
    - reasoning_effort

OpenAI Codex CLI

Codex 0.139+ speaks only the OpenAI Responses API. Our gateway translates it — tool calls and reasoning included — so Codex runs on your GPU. Add a provider to ~/.codex/config.toml:

model_provider = "affordableai"
model = "deepseek-ai/DeepSeek-V4-Flash"

[model_providers.affordableai]
name = "AffordableAI"
base_url = "https://api.affordableai.eu/v1"
env_key = "AFFORDABLEAI_API_KEY"
wire_api = "responses"
export AFFORDABLEAI_API_KEY="YOUR_API_KEY"
codex "refactor the auth module"

Pi

Pi is a provider-agnostic coding agent. Add an OpenAI-compatible provider to ~/.pi/agent/models.json:

{
  "providers": {
    "affordableai": {
      "baseUrl": "https://api.affordableai.eu/v1",
      "api": "openai-completions",
      "apiKey": "$AFFORDABLEAI_API_KEY",
      "authHeader": true,
      "models": [{ "id": "deepseek-ai/DeepSeek-V4-Flash", "reasoning": true }]
    }
  }
}
pi --provider affordableai --model deepseek-ai/DeepSeek-V4-Flash

opencode

Add a custom provider to ~/.config/opencode/opencode.json:

{
  "provider": {
    "affordableai": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "AffordableAI",
      "options": {
        "baseURL": "https://api.affordableai.eu/v1",
        "apiKey": "{env:AFFORDABLEAI_API_KEY}"
      },
      "models": { "deepseek-ai/DeepSeek-V4-Flash": { "name": "DeepSeek V4 Flash" } }
    }
  }
}
opencode run -m affordableai/deepseek-ai/DeepSeek-V4-Flash "explain this repo"

goose

export GOOSE_PROVIDER=openai
export GOOSE_MODEL=deepseek-ai/DeepSeek-V4-Flash
export OPENAI_HOST=https://api.affordableai.eu
export OPENAI_BASE_PATH=v1/chat/completions
export OPENAI_API_KEY=YOUR_API_KEY
goose run -t "add tests for utils.py"

Hermes (NousResearch)

Hermes Agent points at any OpenAI-compatible endpoint. In ~/.hermes/config.yaml, set the custom provider and put your key in api_key (the custom provider reads it from config, not OPENAI_API_KEY):

agent:
  provider: "custom"
  base_url: "https://api.affordableai.eu/v1"
  api_key: "YOUR_API_KEY"
hermes -m deepseek-ai/DeepSeek-V4-Flash "summarize this codebase"

curl

curl -X POST https://api.affordableai.eu/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-ai/DeepSeek-V4-Flash","messages":[{"role":"user","content":"Hello!"}]}'

Streaming

Add "stream": true for token-by-token SSE — what every coding agent uses. Works on every endpoint.

curl -X POST https://api.affordableai.eu/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-ai/DeepSeek-V4-Flash","stream":true,"messages":[{"role":"user","content":"Hello!"}]}'

Open WebUI

1. Admin Panel -> Settings -> Connections
2. OpenAI API URL: https://api.affordableai.eu/v1
3. API Key: YOUR_API_KEY
4. Add model: deepseek-ai/DeepSeek-V4-Flash

Reasoning / Thinking

Reasoning is inline by default — the model thinks through problems in the response text. This is fast and works with all tools.

To get a separate reasoning trace (reasoning_content) in any OpenAI-compatible tool, send "reasoning_effort" — the gateway turns on the model's thinking for you:

curl -X POST https://api.affordableai.eu/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model":"deepseek-ai/DeepSeek-V4-Flash",
  "messages":[{"role":"user","content":"What is 17 * 24?"}],
  "reasoning_effort":"low"
}'

Tool Calling / Function Calling

Standard OpenAI function calling works. The model emits tool calls and our gateway preserves them across multi-turn conversations so your agent sessions stay fast.

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "parameters": {"city": {"type": "string"}}
    }
}]
response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Flash",
    messages=[{"role": "user", "content": "Weather in Berlin?"}],
    tools=tools,
)

Capabilities

Model          deepseek-ai/DeepSeek-V4-Flash
Context        1M tokens  (trial: 32K / session)
Streaming      yes (SSE)
Tool calling   yes  (OpenAI, Anthropic, and Responses APIs)
Reasoning      yes  (reasoning_effort / thinking)
Vision, audio  no   (text model)
Embeddings     not served

Endpoints

OpenAI       https://api.affordableai.eu/v1   ->  /chat/completions  /responses  /models
Anthropic    https://api.affordableai.eu      ->  /v1/messages

Good to know

Errors & limits

Errors come back as JSON with an error field and a standard HTTP status:

401   invalid or missing API key
400   malformed request
413   trial context limit reached (32K / session)
429   rate or concurrency limit hit
5xx   upstream / transient — retry with backoff
Limits: trial keys get 100 requests/day, 2 concurrent, 32K context per session. Paid (€30/month) lifts all three. All data stays in the EU. Nothing is stored.