7API works with the coding tools developers already use. The common pattern is the same everywhere: point the tool at the 7API base URL, provide the key, and choose a current model ID.
Replace
MODEL_IDwith an ID from the 7API dashboard. Model IDs change as providers release new versions.
Claude Code speaks the Anthropic Messages API. Configure it with environment variables:
export ANTHROPIC_BASE_URL="https://.../v1"
export ANTHROPIC_AUTH_TOKEN="sk-..." # some versions use ANTHROPIC_API_KEY
export ANTHROPIC_MODEL="MODEL_ID"Start Claude Code from the same shell so it inherits the variables:
claudeIf Claude Code ignores the custom URL:
- Confirm you are editing the environment of the process that launches it.
- Check whether your version expects
ANTHROPIC_AUTH_TOKENorANTHROPIC_API_KEY. - Verify the base URL is the Anthropic-compatible URL from the dashboard.
- Test the key with a direct
curlto/messagesbefore debugging the tool.
Cursor supports custom OpenAI-compatible providers.
- Open Cursor Settings → Models.
- Add your 7API key as the OpenAI API key.
- Enable Override OpenAI Base URL and paste the OpenAI-compatible base URL from the dashboard.
- Add the model ID you want to use.
- Send a short test prompt and confirm the request appears in your 7API usage.
If Cursor returns 404, the base URL is usually the culprit. Use the exact URL, including the version prefix if the dashboard shows one.
OpenCode supports custom providers through its configuration file. A minimal opencode.json provider entry looks like this:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"7api": {
"npm": "@ai-sdk/openai-compatible",
"name": "7API",
"options": {
"baseURL": "https://.../v1",
"apiKey": "{env:SEVEN_API_KEY}"
},
"models": {
"MODEL_ID": {
"name": "7API Model"
}
}
}
}
}Then select the provider and model in OpenCode. Keep the key in an environment variable rather than committing it to the config file.
Codex CLI supports custom model providers through its configuration file. A typical ~/.codex/config.toml setup:
model = "MODEL_ID"
model_provider = "7api"
[model_providers.7api]
name = "7API"
base_url = "https://.../v1"
env_key = "SEVEN_API_KEY"Set the key in your shell:
export SEVEN_API_KEY="sk-..."If Codex CLI reports an authentication error, confirm that env_key matches the variable name and that the variable is exported in the same shell.
- Claude family — detailed reasoning, large refactors, careful instructions.
- GPT family — broad tool support and predictable instruction following.
- DeepSeek family — cost-efficient coding and batch work.
- GLM family — agent workflows and bilingual projects.
- Kimi family — long repository context and document-heavy tasks.
Test the exact model ID on your repository before committing to it for daily work. Keep a fallback model configured in case a variant is unavailable.
- API key stored in an environment variable or secrets manager.
- No key committed to
opencode.json,config.toml,.envfiles or shell history. - Base URL copied from the dashboard, not guessed.
- Model ID copied from the dashboard.
- Usage and balance visible in the 7API dashboard.
- Subkey used for shared machines or teammates.