For AI agents
Your agent can set itself up.
Paste one line into Claude Code, Codex, Cursor or any agent. It reads the instructions, asks you to approve a code, then stores its key and tests it. No keys pasted into chats.
Read https://quotax.sh/skill.md and set yourself up to use quotax.
Or run the installer
curl -fsSL https://quotax.sh/init | sh curl -fsSL https://quotax.sh/init \
| sh -s -- start
curl -fsSL https://quotax.sh/init \
| sh -s -- wait Some agents only see shell output when a command ends. They run start, show you the code, then run wait. Both need only sh and curl.
How it works
One approval, no pasted secrets.
- 1
Your agent asks for a code
It calls the device endpoint or runs the installer, then shows you a short code like
BCDF-GHJKand a link. - 2
You approve it
Open /activate while signed in, check the code and the agent name, pick Free or Pay as you go, and approve.
- 3
The agent stores and tests its key
It receives a qtx-… key once, saves it to a private file and makes a tiny test call. Only the key prefix is printed.
Per client
Set up your tool.
Each lane works with a key from the device flow or one you create in the dashboard. Model ids change, so pick one from Models instead of copying it from an old example.
The installer saves your key to ~/.config/quotax/env. Load it into any shell with:
set -a; . "${QUOTAX_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/quotax}/env"; set +a Claude Code speaks the Anthropic API, so the base URL is https://quotax.sh without /v1.
export ANTHROPIC_BASE_URL=https://quotax.sh
export ANTHROPIC_AUTH_TOKEN=$QUOTAX_API_KEY
# pick an id from https://quotax.sh/models
export ANTHROPIC_MODEL=your-model-id
# Subagents and background tasks use these aliases
export ANTHROPIC_DEFAULT_OPUS_MODEL=your-model-id
export ANTHROPIC_DEFAULT_SONNET_MODEL=your-model-id
export ANTHROPIC_DEFAULT_HAIKU_MODEL=your-model-id
claude Add the MCP server so Claude can list models, check your balance and test a model by itself:
claude mcp add --transport http quotax https://quotax.sh/mcp \
--header "Authorization: Bearer $QUOTAX_API_KEY" Codex uses the Responses API. Register quotax as a provider in ~/.codex/config.toml; this base URL ends in /v1.
# pick an id from https://quotax.sh/models
model = "your-model-id"
model_provider = "quotax"
[model_providers.quotax]
name = "quotax.sh"
base_url = "https://quotax.sh/v1"
env_key = "QUOTAX_API_KEY"
wire_api = "responses" The MCP server goes in the same file:
[mcp_servers.quotax]
url = "https://quotax.sh/mcp"
bearer_token_env_var = "QUOTAX_API_KEY" Add an OpenAI-compatible provider and the remote MCP server to opencode.json. List each model id you use under models.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"quotax": {
"npm": "@ai-sdk/openai-compatible",
"name": "quotax.sh",
"options": {
"baseURL": "https://quotax.sh/v1",
"apiKey": "{env:QUOTAX_API_KEY}"
},
"models": {
"your-model-id": {}
}
}
},
"mcp": {
"quotax": {
"type": "remote",
"url": "https://quotax.sh/mcp",
"headers": { "Authorization": "Bearer {env:QUOTAX_API_KEY}" }
}
}
} In Cursor Settings → Models, turn on the OpenAI API key, paste your key, set Override OpenAI Base URL to https://quotax.sh/v1, then add a model id.
For the MCP tools, add quotax to ~/.cursor/mcp.json:
{
"mcpServers": {
"quotax": {
"url": "https://quotax.sh/mcp",
"headers": { "Authorization": "Bearer ${env:QUOTAX_API_KEY}" }
}
}
} quotax runs a remote MCP server at https://quotax.sh/mcp over Streamable HTTP. Public tools work without a key; account tools need Authorization: Bearer qtx-….
claude mcp add --transport http quotax https://quotax.sh/mcp \
--header "Authorization: Bearer $QUOTAX_API_KEY" Any client that takes a URL and headers:
{
"url": "https://quotax.sh/mcp",
"headers": { "Authorization": "Bearer qtx-your-key" }
} | Tool | Key | What it does |
|---|---|---|
| quotax_list_models | No | Live models, context, prices and free promos |
| quotax_client_config | No | Ready-to-paste config for a client, with $QUOTAX_API_KEY |
| quotax_docs | No | Docs as Markdown by topic |
| quotax_account | Needed | Plan, limits, wallet and the models this key can call |
| quotax_usage | Needed | Requests, tokens and cost for 1–90 days |
| quotax_test_model | Needed | One tiny Chat Completions call, billed like any request |
Paste this into the system prompt or rules file of any agent or framework.
You can call LLMs through quotax.sh.
- OpenAI-compatible base URL: https://quotax.sh/v1 (Chat Completions, Responses)
- Anthropic-compatible base URL: https://quotax.sh (no /v1)
- Auth: Authorization: Bearer $QUOTAX_API_KEY (keys start with qtx-)
- Model ids change: list them with GET https://quotax.sh/v1/models (with the key)
or GET https://quotax.sh/api/public/catalog (no key). Never hardcode one.
- No key yet? Follow https://quotax.sh/skill.md. You get a code; the user
approves it at https://quotax.sh/activate.
- 402 means the wallet is empty: ask the user to top up at
https://quotax.sh/app/billing. On 429, wait for retry-after. For machines
Everything an agent can read.
Plain text and JSON, built from the live catalog. Give an agent /skill.md and it finds the rest.
- /llms.txt Site index for LLMs: key facts, common mistakes and the live model list
- /llms-full.txt llms.txt, skill.md, the docs and this page in one file
- /skill.md Agent Skill: the one URL to give any agent
- /openapi.json OpenAPI 3.1 for /v1, the public catalog and the agent endpoints
- /.well-known/api-catalog RFC 9727 API catalog with links to the spec and docs
- /.well-known/agent-skills/index.json Agent Skills discovery index
- /mcp Remote MCP server (Streamable HTTP, POST only)
- /agents.md This page as Markdown
Troubleshooting
When something fails.
| Symptom | Cause | Fix |
|---|---|---|
| 401 authentication_error | Cause The key is wrong, deleted or disabled, or it was sent in a header quotax does not read. | Fix Send it as Authorization: Bearer qtx-… or x-api-key: qtx-…, and check it on API keys. |
| 404 from Claude Code or an Anthropic SDK | Cause The base URL ends in /v1, so requests go to /v1/v1/messages. | Fix Use https://quotax.sh for Anthropic clients. Only OpenAI clients use https://quotax.sh/v1. |
| 403 permission_error | Cause A Free key called a model that is not free right now. | Fix Pick a free model from Models, or approve a Pay as you go key. |
| 402 Payment Required | Cause The Pay as you go wallet is empty or too low for the request. | Fix A human tops up with VietQR on Wallet & billing. Agents cannot pay. |
| 429 rate limit | Cause The key hit its per-minute, concurrency or daily limit. | Fix Wait for retry-after. Daily limits reset at midnight Asia/Ho_Chi_Minh (GMT+7). |
| /v1/models is empty | Cause The key is Free and no model is free right now. | Fix Use a Pay as you go key, or check /api/public/catalog (no key needed) for promotions. |
| Code not accepted on /activate | Cause Codes expire after 15 minutes and work once. | Fix Ask the agent to start again for a new code. |