# Quickstart

> Get a 7API key and connect Claude Code, OpenCode, Codex CLI, Cline, Roo Code, Oh My Pi or CommandCode in a few minutes. Raw API examples for curl, the OpenAI SDK and the Anthropic SDK at the end.


This page takes you from no account to a working coding agent in about five minutes. Pick the tool you already use; each one needs only a base URL and your key.

## 1. Create an account and copy your key

Open [7api.st](https://7api.st/) and choose **Create account**. You don't need an email address. The site shows your API key once, so save it somewhere safe. The key is also your login. Keys look like `sk-` followed by 48 hexadecimal characters.

You can also sign up through the Telegram bot [@hqclaudebot](https://t.me/hqclaudebot). Both routes create the same kind of account.

## 2. Add funds

Requests need a positive balance. Open **Add funds** in the dashboard, pick an amount ($5 minimum) and pay with crypto. The balance is credited automatically once the payment confirms on-chain. See [Pricing and billing](https://7api.st/docs/pricing-and-billing) for the bonus tiers.

## 3. Connect your tool

> **Tip:** The dashboard's [Setup page](https://7api.st/setup) generates every config below with your key already filled in.

### Claude Code
1. Save this as `~/.claude/settings.json` (Windows: `%USERPROFILE%\.claude\settings.json`) and replace `YOUR_7API_KEY` with your key.
2. Run `claude` in your project folder.
3. Pick a model with `/model`. Non-Claude models take a `claude-` prefix, for example `/model claude-glm-5.3`.

```json title="settings.json"
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://7api.st",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_7API_KEY",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0",
    "DISABLE_TELEMETRY": "1",
    "DISABLE_ERROR_REPORTING": "1",
    "DISABLE_AUTOUPDATER": "1",
    "DISABLE_BUG_COMMAND": "1",
    "DISABLE_COST_WARNINGS": "1",
    "DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1"
  },
  "permissions": {
    "defaultMode": "auto"
  },
  "model": "opus[1m]",
  "effortLevel": "high",
  "theme": "dark"
}
```

### OpenCode
1. Save this as `~/.config/opencode/opencode.json` (Windows: `%USERPROFILE%\.config\opencode\opencode.json`).
2. Replace `YOUR_7API_KEY` with your key. It appears once per provider block.
3. Run `opencode`, pick a model with `/models` and cycle reasoning effort with **Ctrl+T**.

```json title="opencode.json"
{
  "$schema": "https://opencode.ai/config.json",
  "model": "7api/gpt-6.1-sol",
  "small_model": "7api/gpt-6-luna",
  "provider": {
    "7api": {
      "npm": "@ai-sdk/openai",
      "name": "7API — GPT",
      "options": {
        "baseURL": "https://7api.st/v1",
        "apiKey": "YOUR_7API_KEY"
      },
      "models": {
        "gpt-6-astra": {"name":"GPT-6 Astra","limit":{"context":1050000,"output":128000},"reasoning":true,"tool_call":true,"options":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"variants":{"none":{"reasoningEffort":"none","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"low":{"reasoningEffort":"low","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"medium":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"high":{"reasoningEffort":"high","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"xhigh":{"reasoningEffort":"xhigh","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"max":{"reasoningEffort":"max","reasoningSummary":"auto","include":["reasoning.encrypted_content"]}}},
        "gpt-6.2-astra": {"name":"GPT-6.2 Astra","limit":{"context":1050000,"output":128000},"reasoning":true,"tool_call":true,"options":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"variants":{"none":{"reasoningEffort":"none","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"low":{"reasoningEffort":"low","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"medium":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"high":{"reasoningEffort":"high","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"xhigh":{"reasoningEffort":"xhigh","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"max":{"reasoningEffort":"max","reasoningSummary":"auto","include":["reasoning.encrypted_content"]}}},
        "gpt-6.1-sol": {"name":"GPT-6.1 Sol","limit":{"context":1050000,"output":128000},"reasoning":true,"tool_call":true,"options":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"variants":{"none":{"reasoningEffort":"none","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"low":{"reasoningEffort":"low","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"medium":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"high":{"reasoningEffort":"high","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"xhigh":{"reasoningEffort":"xhigh","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"max":{"reasoningEffort":"max","reasoningSummary":"auto","include":["reasoning.encrypted_content"]}}},
        "gpt-6.2-sol": {"name":"GPT-6.2 Sol","limit":{"context":1050000,"output":128000},"reasoning":true,"tool_call":true,"options":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"variants":{"none":{"reasoningEffort":"none","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"low":{"reasoningEffort":"low","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"medium":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"high":{"reasoningEffort":"high","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"xhigh":{"reasoningEffort":"xhigh","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"max":{"reasoningEffort":"max","reasoningSummary":"auto","include":["reasoning.encrypted_content"]}}},
        "gpt-6-sol": {"name":"GPT-6 Sol","limit":{"context":1050000,"output":128000},"reasoning":true,"tool_call":true,"options":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"variants":{"none":{"reasoningEffort":"none","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"low":{"reasoningEffort":"low","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"medium":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"high":{"reasoningEffort":"high","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"xhigh":{"reasoningEffort":"xhigh","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"max":{"reasoningEffort":"max","reasoningSummary":"auto","include":["reasoning.encrypted_content"]}}},
        "gpt-6-luna": {"name":"GPT-6 Luna","limit":{"context":1050000,"output":128000},"reasoning":true,"tool_call":true,"options":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"variants":{"none":{"reasoningEffort":"none","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"low":{"reasoningEffort":"low","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"medium":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"high":{"reasoningEffort":"high","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"xhigh":{"reasoningEffort":"xhigh","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"max":{"reasoningEffort":"max","reasoningSummary":"auto","include":["reasoning.encrypted_content"]}}},
        "gpt-5.6-sol": {"name":"GPT-5.6 Sol","limit":{"context":1000000,"output":128000},"reasoning":true,"tool_call":true,"options":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"variants":{"none":{"reasoningEffort":"none","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"low":{"reasoningEffort":"low","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"medium":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"high":{"reasoningEffort":"high","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"xhigh":{"reasoningEffort":"xhigh","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"max":{"reasoningEffort":"max","reasoningSummary":"auto","include":["reasoning.encrypted_content"]}}},
        "gpt-5.6-terra": {"name":"GPT-5.6 Terra","limit":{"context":1000000,"output":128000},"reasoning":true,"tool_call":true,"options":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"variants":{"none":{"reasoningEffort":"none","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"low":{"reasoningEffort":"low","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"medium":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"high":{"reasoningEffort":"high","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"xhigh":{"reasoningEffort":"xhigh","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"max":{"reasoningEffort":"max","reasoningSummary":"auto","include":["reasoning.encrypted_content"]}}},
        "gpt-5.6-luna": {"name":"GPT-5.6 Luna","limit":{"context":1000000,"output":128000},"reasoning":true,"tool_call":true,"options":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"variants":{"none":{"reasoningEffort":"none","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"low":{"reasoningEffort":"low","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"medium":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"high":{"reasoningEffort":"high","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"xhigh":{"reasoningEffort":"xhigh","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"max":{"reasoningEffort":"max","reasoningSummary":"auto","include":["reasoning.encrypted_content"]}}},
        "gpt-5.5": {"name":"GPT-5.5","limit":{"context":1000000,"output":128000},"reasoning":true,"tool_call":true,"options":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"variants":{"none":{"reasoningEffort":"none","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"low":{"reasoningEffort":"low","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"medium":{"reasoningEffort":"medium","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"high":{"reasoningEffort":"high","reasoningSummary":"auto","include":["reasoning.encrypted_content"]},"xhigh":{"reasoningEffort":"xhigh","reasoningSummary":"auto","include":["reasoning.encrypted_content"]}}}
      }
    },
    "7api-claude": {
      "npm": "@ai-sdk/anthropic",
      "name": "7API — Claude",
      "options": {
        "baseURL": "https://7api.st/v1",
        "apiKey": "YOUR_7API_KEY"
      },
      "models": {
        "claude-fable-5-2": {"name":"Claude Fable 5.2","limit":{"context":1000000,"output":64000},"reasoning":true,"tool_call":true,"options":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"variants":{"none":{"thinking":{"type":"disabled"}},"low":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"low"},"medium":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"high":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"high"},"xhigh":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"xhigh"},"max":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"max"}}},
        "claude-opus-5-5-max": {"name":"Claude Opus 5.5 Max","limit":{"context":1000000,"output":128000},"attachment":true,"modalities":{"input":["text","image"],"output":["text"]},"reasoning":true,"tool_call":true,"options":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"variants":{"none":{"thinking":{"type":"disabled"}},"low":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"low"},"medium":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"high":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"high"},"xhigh":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"xhigh"},"max":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"max"}}},
        "claude-opus-5-5": {"name":"Claude Opus 5.5","limit":{"context":1000000,"output":128000},"attachment":true,"modalities":{"input":["text","image"],"output":["text"]},"reasoning":true,"tool_call":true,"options":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"variants":{"none":{"thinking":{"type":"disabled"}},"low":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"low"},"medium":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"high":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"high"},"xhigh":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"xhigh"},"max":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"max"}}},
        "claude-opus-5": {"name":"Claude Opus 5","limit":{"context":1000000,"output":64000},"reasoning":true,"tool_call":true,"options":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"variants":{"none":{"thinking":{"type":"disabled"}},"low":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"low"},"medium":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"high":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"high"},"xhigh":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"xhigh"},"max":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"max"}}},
        "claude-opus-4-8": {"name":"Claude Opus 4.8","limit":{"context":1000000,"output":64000},"reasoning":true,"tool_call":true,"options":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"variants":{"none":{"thinking":{"type":"disabled"}},"low":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"low"},"medium":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"high":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"high"},"xhigh":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"xhigh"},"max":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"max"}}},
        "claude-opus-4-7": {"name":"Claude Opus 4.7","limit":{"context":1000000,"output":64000},"reasoning":true,"tool_call":true,"options":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"variants":{"none":{"thinking":{"type":"disabled"}},"low":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"low"},"medium":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"high":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"high"},"xhigh":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"xhigh"},"max":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"max"}}},
        "claude-opus-4-6": {"name":"Claude Opus 4.6","limit":{"context":1000000,"output":64000},"reasoning":true,"tool_call":true,"options":{"thinking":{"type":"adaptive"},"effort":"medium"},"variants":{"none":{"thinking":{"type":"disabled"}},"low":{"thinking":{"type":"adaptive"},"effort":"low"},"medium":{"thinking":{"type":"adaptive"},"effort":"medium"},"high":{"thinking":{"type":"adaptive"},"effort":"high"},"max":{"thinking":{"type":"adaptive"},"effort":"max"}}},
        "claude-sonnet-5-5": {"name":"Claude Sonnet 5.5","limit":{"context":1000000,"output":64000},"reasoning":true,"tool_call":true,"options":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"variants":{"none":{"thinking":{"type":"disabled"}},"low":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"low"},"medium":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"high":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"high"},"xhigh":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"xhigh"},"max":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"max"}}},
        "claude-sonnet-5": {"name":"Claude Sonnet 5","limit":{"context":1000000,"output":64000},"reasoning":true,"tool_call":true,"options":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"variants":{"none":{"thinking":{"type":"disabled"}},"low":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"low"},"medium":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"high":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"high"},"xhigh":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"xhigh"},"max":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"max"}}},
        "claude-haiku-5-5": {"name":"Claude Haiku 5.5","limit":{"context":1000000,"output":64000},"reasoning":true,"tool_call":true,"options":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"variants":{"none":{"thinking":{"type":"disabled"}},"low":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"low"},"medium":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"medium"},"high":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"high"},"xhigh":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"xhigh"},"max":{"thinking":{"type":"adaptive","display":"summarized"},"effort":"max"}}}
      }
    },
    "7api-other": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "7API — Other",
      "options": {
        "baseURL": "https://7api.st/v1",
        "apiKey": "YOUR_7API_KEY"
      },
      "models": {
        "gemini-4-carbon": {"name":"Gemini 4 Carbon","limit":{"context":1048576,"output":16384},"attachment":true,"modalities":{"input":["text","image"],"output":["text"]},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"}},
        "gemini-4-argon": {"name":"Gemini 4 Argon","limit":{"context":128000,"output":16384},"attachment":true,"modalities":{"input":["text","image"],"output":["text"]},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"}},
        "glm-5.2": {"name":"GLM-5.2","limit":{"context":1000000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"medium"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"medium":{"reasoningEffort":"medium"},"high":{"reasoningEffort":"high"},"xhigh":{"reasoningEffort":"xhigh"},"max":{"reasoningEffort":"max"}}},
        "glm-5.3": {"name":"GLM-5.3","limit":{"context":1000000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"medium"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"medium":{"reasoningEffort":"medium"},"high":{"reasoningEffort":"high"},"xhigh":{"reasoningEffort":"xhigh"},"max":{"reasoningEffort":"max"}}},
        "glm-5.3-uncensored": {"name":"GLM-5.3 Uncensored","limit":{"context":1000000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"medium"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"medium":{"reasoningEffort":"medium"},"high":{"reasoningEffort":"high"},"xhigh":{"reasoningEffort":"xhigh"},"max":{"reasoningEffort":"max"}}},
        "glm-5.3-flash": {"name":"GLM-5.3 Flash","limit":{"context":1000000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"medium"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"medium":{"reasoningEffort":"medium"},"high":{"reasoningEffort":"high"},"xhigh":{"reasoningEffort":"xhigh"},"max":{"reasoningEffort":"max"}}},
        "glm-5.3-flash-uncensored": {"name":"GLM-5.3 Flash Uncensored","limit":{"context":1000000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"medium"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"medium":{"reasoningEffort":"medium"},"high":{"reasoningEffort":"high"},"xhigh":{"reasoningEffort":"xhigh"},"max":{"reasoningEffort":"max"}}},
        "glm-5.3-abliterated": {"name":"GLM-5.3 Abliterated (100% Uncensored)","limit":{"context":1000000,"output":130000},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"high"},"variants":{"high":{"reasoningEffort":"high"},"xhigh":{"reasoningEffort":"xhigh"},"max":{"reasoningEffort":"max"}}},
        "deepseek-v4-flash-0731": {"name":"DeepSeek V4 Flash","limit":{"context":1000000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"medium"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"medium":{"reasoningEffort":"medium"},"high":{"reasoningEffort":"high"}}},
        "deepseek-v4.1-flash": {"name":"DeepSeek V4.1 Flash","limit":{"context":1000000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"medium"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"medium":{"reasoningEffort":"medium"},"high":{"reasoningEffort":"high"}}},
        "deepseek-v4.1-flash-1017": {"name":"DeepSeek V4.1 Flash 1017","limit":{"context":1000000,"output":65536},"attachment":true,"modalities":{"input":["text","image"],"output":["text"]},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"medium"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"medium":{"reasoningEffort":"medium"},"high":{"reasoningEffort":"high"}}},
        "deepseek-v4.1-flash-1017-hq": {"name":"DeepSeek V4.1 Flash 1017 HQ","limit":{"context":1000000,"output":65536},"attachment":true,"modalities":{"input":["text","image"],"output":["text"]},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"medium"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"medium":{"reasoningEffort":"medium"},"high":{"reasoningEffort":"high"}}},
        "deepseek-v4.1-flash-1017-abliterated": {"name":"DeepSeek V4.1 Flash 1017 Abliterated","limit":{"context":1000000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"high"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"high":{"reasoningEffort":"high"},"max":{"reasoningEffort":"max"}}},
        "deepseek-v4.1-flash-1017-abliterated-fast": {"name":"DeepSeek V4.1 Flash 1017 Abliterated Fast","limit":{"context":1000000,"output":65536},"attachment":true,"modalities":{"input":["text","image"],"output":["text"]},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"medium"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"medium":{"reasoningEffort":"medium"},"high":{"reasoningEffort":"high"}}},
        "deepseek-v4-pro-0813": {"name":"DeepSeek V4 Pro","limit":{"context":1000000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"medium"},"variants":{"none":{"reasoningEffort":"none"},"low":{"reasoningEffort":"low"},"medium":{"reasoningEffort":"medium"},"high":{"reasoningEffort":"high"}}},
        "mimo-v2.6-pro": {"name":"MiMo V2.6 Pro","limit":{"context":600000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"}},
        "mimo-v2.6-flash": {"name":"MiMo V2.6 Flash","limit":{"context":600000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"}},
        "kimi-k3": {"name":"Kimi K3","limit":{"context":1000000,"output":65536},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"max"},"variants":{"low":{"reasoningEffort":"low"},"high":{"reasoningEffort":"high"},"max":{"reasoningEffort":"max"}}},
        "kimi-k3.1-pro": {"name":"Kimi K3.1 Pro","limit":{"context":1000000,"output":32000},"attachment":true,"modalities":{"input":["text","image"],"output":["text"]},"reasoning":true,"tool_call":true,"interleaved":{"field":"reasoning_content"},"options":{"reasoningEffort":"max"},"variants":{"low":{"reasoningEffort":"low"},"high":{"reasoningEffort":"high"},"max":{"reasoningEffort":"max"}}},
        "grok-4.7": {"name":"Grok 4.7","limit":{"context":500000,"output":65536}},
        "grok-4.6": {"name":"Grok 4.6","limit":{"context":500000,"output":65536}},
        "grok-4.5": {"name":"Grok 4.5","limit":{"context":200000,"output":64000}}
      }
    }
  }
}
```

### Codex CLI
1. Save this as `~/.codex/config.toml` (Windows: `%USERPROFILE%\.codex\config.toml`).
2. Replace `YOUR_7API_KEY` with your key.
3. Run `codex`. The default model is `gpt-6-astra`; change `model` to switch.

```toml title="config.toml"
# GPT-6 Astra: 1.05M context, auto-compacts at 900K (leaves room for 128K output).
# gpt-6.1-sol and gpt-6-luna use the same limits.
model = "gpt-6-astra"
model_provider = "7api"
model_reasoning_effort = "high"
approval_policy = "never"
model_context_window = 1050000
model_auto_compact_token_limit = 900000

[model_providers.7api]
name = "7api"
base_url = "https://7api.st"
wire_api = "responses"
experimental_bearer_token = "YOUR_7API_KEY"

[windows]
sandbox = "elevated"
```

### Cursor
> **No longer works:** Cursor has patched `cursor-byok`, and this setup no longer works. Use another harness, such as **[OpenCode](https://7api.st/docs/guides/opencode)**, **[Oh My Pi (OMP)](https://7api.st/docs/guides/oh-my-pi)**, or another compatible client. Do not follow the steps below; they are kept only for historical reference.

1. Install Cursor, then download [cursor-byok](https://github.com/leookun/cursor-byok/releases) for your OS and follow its setup guide.
2. In cursor-byok, open **Model Settings** and add a model with base URL `https://7api.st/v1`, your 7API key, and the model type, protocol and ID from the table.
3. Keep **full URL mode** off, test the model and start the cursor-byok service.
4. Fully quit and reopen Cursor, start a new chat and select your model.

| Model family | Model type | Request protocol | Example model ID |
|---|---|---|---|
| Claude | Anthropic | Messages (automatic, no setting) | `claude-opus-5-5` |
| GPT | OpenAI | Responses API | `gpt-6-astra` |
| GLM, DeepSeek, Kimi, Grok, Gemini | OpenAI | Chat Completions | `glm-5.3`, `kimi-k3` |

### Cline / Roo / Continue
1. Open the extension's settings in VS Code (**Ctrl+,** or **Cmd+,**).
2. For Claude models, choose the **Anthropic** provider. For every other model, choose **OpenAI Compatible**.
3. Enter the base URL and your key from the table, then type a model ID.

| | Claude models | Every other model |
|---|---|---|
| Provider | Anthropic | OpenAI Compatible |
| Base URL | `https://7api.st` | `https://7api.st/v1` |
| API key | Your 7API key | Your 7API key |
| Model | `claude-opus-5-5` | `glm-5.3`, `gpt-6.1-sol`, `kimi-k3` |

### Oh My Pi
1. Install OMP: `curl -fsSL https://omp.sh/install | sh`
2. Save this as `~/.omp/agent/models.yml` (Windows: `%USERPROFILE%\.omp\agent\models.yml`) and replace `YOUR_7API_KEY`.
3. Run `omp`, pick a model with `/model` and set effort with `/effort` or **Shift+Tab**.

```yaml title="models.yml"
providers:
  7api:
    baseUrl: https://7api.st/v1
    api: openai-completions
    auth: apiKey
    apiKey: "YOUR_7API_KEY"
    models:
      - id: gpt-6-astra
        name: GPT-6 Astra
        api: openai-responses
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1050000
        maxTokens: 128000
      - id: gpt-6.2-astra
        name: GPT-6.2 Astra
        api: openai-responses
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1050000
        maxTokens: 128000
      - id: gpt-6.1-sol
        name: GPT-6.1 Sol
        api: openai-responses
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1050000
        maxTokens: 128000
      - id: gpt-6.2-sol
        name: GPT-6.2 Sol
        api: openai-responses
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1050000
        maxTokens: 128000
      - id: gpt-6-sol
        name: GPT-6 Sol
        api: openai-responses
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1050000
        maxTokens: 128000
      - id: gpt-6-luna
        name: GPT-6 Luna
        api: openai-responses
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1050000
        maxTokens: 128000
      - id: gpt-5.6-sol
        name: GPT-5.6 Sol
        api: openai-responses
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 128000
      - id: gpt-5.6-terra
        name: GPT-5.6 Terra
        api: openai-responses
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 128000
      - id: gpt-5.6-luna
        name: GPT-5.6 Luna
        api: openai-responses
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 128000
      - id: gpt-5.5
        name: GPT-5.5
        api: openai-responses
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high, xhigh] }
        contextWindow: 1000000
        maxTokens: 128000
      - id: claude-fable-5-2
        name: Claude Fable 5.2
        api: anthropic-messages
        reasoning: true
        thinking: { mode: anthropic-adaptive, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 64000
      - id: claude-opus-5-5-max
        name: Claude Opus 5.5 Max
        api: anthropic-messages
        input: [text, image]
        reasoning: true
        thinking: { mode: anthropic-adaptive, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 128000
      - id: claude-opus-5-5
        name: Claude Opus 5.5
        api: anthropic-messages
        input: [text, image]
        reasoning: true
        thinking: { mode: anthropic-adaptive, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 128000
      - id: claude-opus-5
        name: Claude Opus 5
        api: anthropic-messages
        reasoning: true
        thinking: { mode: anthropic-adaptive, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 64000
      - id: claude-opus-4-8
        name: Claude Opus 4.8
        api: anthropic-messages
        reasoning: true
        thinking: { mode: anthropic-adaptive, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 64000
      - id: claude-opus-4-7
        name: Claude Opus 4.7
        api: anthropic-messages
        reasoning: true
        thinking: { mode: anthropic-adaptive, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 64000
      - id: claude-opus-4-6
        name: Claude Opus 4.6
        api: anthropic-messages
        reasoning: true
        thinking: { mode: anthropic-adaptive, efforts: [low, medium, high, max] }
        contextWindow: 1000000
        maxTokens: 64000
      - id: claude-sonnet-5-5
        name: Claude Sonnet 5.5
        api: anthropic-messages
        reasoning: true
        thinking: { mode: anthropic-adaptive, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 64000
      - id: claude-sonnet-5
        name: Claude Sonnet 5
        api: anthropic-messages
        reasoning: true
        thinking: { mode: anthropic-adaptive, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 64000
      - id: claude-haiku-5-5
        name: Claude Haiku 5.5
        api: anthropic-messages
        reasoning: true
        thinking: { mode: anthropic-adaptive, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 64000
      - id: gemini-4-carbon
        name: Gemini 4 Carbon
        reasoning: true
        contextWindow: 1048576
        maxTokens: 16384
      - id: gemini-4-argon
        name: Gemini 4 Argon
        reasoning: true
        contextWindow: 128000
        maxTokens: 16384
      - id: deepseek-v4-flash-0731
        name: DeepSeek V4 Flash
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high] }
        contextWindow: 1000000
        maxTokens: 65536
      - id: deepseek-v4.1-flash
        name: DeepSeek V4.1 Flash
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high] }
        contextWindow: 1000000
        maxTokens: 65536
      - id: deepseek-v4.1-flash-1017
        name: DeepSeek V4.1 Flash 1017
        input: [text, image]
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high] }
        contextWindow: 1000000
        maxTokens: 65536
      - id: deepseek-v4.1-flash-1017-hq
        name: DeepSeek V4.1 Flash 1017 HQ
        input: [text, image]
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high] }
        contextWindow: 1000000
        maxTokens: 65536
      - id: deepseek-v4.1-flash-1017-abliterated
        name: DeepSeek V4.1 Flash 1017 Abliterated
        reasoning: true
        thinking: { mode: effort, efforts: [low, high, max], defaultLevel: high }
        contextWindow: 1000000
        maxTokens: 65536
      - id: deepseek-v4.1-flash-1017-abliterated-fast
        name: DeepSeek V4.1 Flash 1017 Abliterated Fast
        input: [text, image]
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high] }
        contextWindow: 1000000
        maxTokens: 65536
      - id: deepseek-v4-pro-0813
        name: DeepSeek V4 Pro
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high] }
        contextWindow: 1000000
        maxTokens: 65536
      - id: mimo-v2.6-pro
        name: MiMo V2.6 Pro
        reasoning: true
        contextWindow: 600000
        maxTokens: 65536
      - id: mimo-v2.6-flash
        name: MiMo V2.6 Flash
        reasoning: true
        contextWindow: 600000
        maxTokens: 65536
      - id: kimi-k3
        name: Kimi K3
        reasoning: true
        thinking: { mode: effort, efforts: [low, high, max], defaultLevel: max, requiresEffort: true }
        contextWindow: 1000000
        maxTokens: 65536
      - id: kimi-k3.1-pro
        name: Kimi K3.1 Pro
        input: [text, image]
        reasoning: true
        thinking: { mode: effort, efforts: [low, high, max], defaultLevel: max, requiresEffort: true }
        contextWindow: 1000000
        maxTokens: 32000
      - id: grok-4.7
        name: Grok 4.7
        reasoning: true
        contextWindow: 500000
        maxTokens: 65536
      - id: grok-4.6
        name: Grok 4.6
        reasoning: true
        contextWindow: 500000
        maxTokens: 65536
      - id: grok-4.5
        name: Grok 4.5
        reasoning: true
        contextWindow: 200000
        maxTokens: 64000
  7api-glm:
    baseUrl: https://7api.st/v1
    api: openai-completions
    apiKey: "YOUR_7API_KEY"
    compat:
      supportsReasoningEffort: true
      thinkingFormat: openai
      reasoningContentField: reasoning_content
    models:
      - id: glm-5.2
        name: GLM-5.2
        reasoning: true
        thinking: { mode: effort, efforts: [low, medium, high, xhigh, max] }
        contextWindow: 1000000
        maxTokens: 65536
      - id: glm-5.3
        name: GLM-5.3
        reasoning: true
        thinking: { mode: effort, efforts: [low, high, xhigh, max], defaultLevel: high, requiresEffort: true }
        contextWindow: 1000000
        maxTokens: 65536
      - id: glm-5.3-uncensored
        name: GLM-5.3 Uncensored
        reasoning: true
        thinking: { mode: effort, efforts: [max], defaultLevel: max, requiresEffort: true }
        contextWindow: 1000000
        maxTokens: 65536
      - id: glm-5.3-flash
        name: GLM-5.3 Flash
        reasoning: true
        thinking: { mode: effort, efforts: [low, high, xhigh, max], defaultLevel: high, requiresEffort: true }
        contextWindow: 1000000
        maxTokens: 65536
      - id: glm-5.3-flash-uncensored
        name: GLM-5.3 Flash Uncensored
        reasoning: true
        thinking: { mode: effort, efforts: [max], defaultLevel: max, requiresEffort: true }
        contextWindow: 1000000
        maxTokens: 65536
      - id: glm-5.3-abliterated
        name: GLM-5.3 Abliterated
        reasoning: true
        thinking: { mode: effort, efforts: [high, xhigh, max], defaultLevel: high, requiresEffort: true }
        contextWindow: 1000000
        maxTokens: 130000
```

### CommandCode
1. Open CommandCode and enter `/connect`.
2. Choose **BYOK** and enter `7api.st` as the **Provider ID**.
3. Choose **OpenAI** and paste `https://7api.st/v1` as the URL.
4. Paste your 7API key.
5. Pick a model. CommandCode reads the list from `/v1/models`, so every model appears automatically.

Full guides with every option: [Claude Code](https://7api.st/docs/guides/claude-code) · [OpenCode](https://7api.st/docs/guides/opencode) · [Codex CLI](https://7api.st/docs/guides/codex) · [Cursor](https://7api.st/docs/guides/cursor) · [Cline, Roo Code, Continue](https://7api.st/docs/guides/vscode) · [Oh My Pi](https://7api.st/docs/guides/oh-my-pi) · [CommandCode](https://7api.st/docs/guides/commandcode).

> **Note:** OpenAI-format tools take the base URL **with** `/v1` (`https://7api.st/v1`). Anthropic-format tools such as Claude Code take it **without** `/v1` (`https://7api.st`), because they add `/v1/messages` themselves. If you get a 404, the most likely cause is a missing or doubled `/v1`.

## 4. Pick a model

Any ID from the [model list](https://7api.st/pricing) works in any tool. Good starting points:

- **Hardest coding tasks:** `claude-opus-5-5` or `gpt-6-astra`
- **Cheap, fast agent work:** `glm-5.3`, `deepseek-v4.1-flash`
- **Fewer refusals:** `glm-5.3-abliterated`, `glm-5.3-uncensored` (see [Uncensored AI API](https://7api.st/uncensored-ai-api))

## 5. Check what you spent

The dashboard's **Usage** page shows spend, tokens and cache savings per period. From a script:

```bash
curl https://7api.st/v1/balance -H "Authorization: Bearer $SEVENAPI_API_KEY"
```

## Call the API directly {#api}

Building your own app instead of using a coding tool? 7API is a drop-in replacement for the OpenAI and Anthropic APIs. Set your key as an environment variable:

```bash
export SEVENAPI_API_KEY="sk-your-key"
```

Then call any model. The examples below use `glm-5.3`; replace it with any ID from the [model list](https://7api.st/pricing).

```bash tab=curl
curl https://7api.st/v1/chat/completions \
  -H "Authorization: Bearer $SEVENAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3",
    "messages": [{"role": "user", "content": "Say hello in five words."}]
  }'
```

```python tab=Python
# pip install openai
import os
from openai import OpenAI

client = OpenAI(base_url="https://7api.st/v1", api_key=os.environ["SEVENAPI_API_KEY"])
reply = client.chat.completions.create(
    model="glm-5.3",
    messages=[{"role": "user", "content": "Say hello in five words."}],
)
print(reply.choices[0].message.content)
```

```js tab=Node.js
// npm install openai
import OpenAI from 'openai';

const client = new OpenAI({ baseURL: 'https://7api.st/v1', apiKey: process.env.SEVENAPI_API_KEY });
const reply = await client.chat.completions.create({
  model: 'glm-5.3',
  messages: [{ role: 'user', content: 'Say hello in five words.' }],
});
console.log(reply.choices[0].message.content);
```

```python tab="Anthropic SDK"
# pip install anthropic
import os
from anthropic import Anthropic

client = Anthropic(base_url="https://7api.st", api_key=os.environ["SEVENAPI_API_KEY"])
reply = client.messages.create(
    model="claude-opus-5-5",
    max_tokens=512,
    messages=[{"role": "user", "content": "Say hello in five words."}],
)
print(reply.content[0].text)
```

Each response includes a `usage` object with input, cached and output token counts. More: [OpenAI-compatible API](https://7api.st/docs/openai-compatible-api) · [Anthropic-compatible API](https://7api.st/docs/anthropic-compatible-api) · [Streaming](https://7api.st/docs/streaming) · [Prompt caching](https://7api.st/docs/prompt-caching).
