Using GrooRoute Pro with the OpenAI SDK, Codex CLI, Claude Code, and OpenCode
GrooRoute Pro is an OpenAI-compatible AI model API gateway. With one account and one API key, you can connect the OpenAI Python and Node SDKs, Codex CLI, Claude Code, and OpenCode over three registered endpoints: POST /v1/chat/completions, POST /v1/responses, and Anthropic-compatible POST /v1/messages.
1. Base URL Rule: With or Without /v1
- OpenAI-compatible clients (OpenAI Python / Node SDK, Codex CLI, OpenCode): use
https://grooroute.com/v1(ends with/v1). These clients append/chat/completionsor/responsesdirectly. - Claude Code (Anthropic Messages protocol): use
https://grooroute.com(root URL without/v1), because Claude Code appends/v1/messagesitself.
2. Published Models & Declared Endpoints
The table below lists the currently published models with active supply and the endpoints declared across public tiers:
| Model ID | Declared Endpoints |
|---|---|
deepseek-v4.1-flash | POST /v1/chat/completions |
gpt-5.6-luna | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gpt-5.6-sol | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gpt-5.6-terra | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gpt-6-astra | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gpt-6-luna | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gpt-6-sol | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gpt-6.1-sol | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gpt-6.1-terra | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gpt-6.2-sol | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gpt-6.2-astra | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
grok-4.7 | POST /v1/chat/completions, POST /v1/responses |
gpt-image-1.5 | None declared |
gpt-image-2 | None declared |
gpt-image-2.5-flare | None declared |
gpt-image-2.5-sunburst | None declared |
gpt-image-2.6-flare | None declared |
gpt-image-2.6-sunburst | None declared |
claude-opus-5-5 | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
claude-opus-4-8 | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
claude-sonnet-5-5 | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
claude-fable-5-2 | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gemini-3.8-flash | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gemini-4-argon | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gemini-4-carbon | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
gemini-4-hydrogen | POST /v1/chat/completions, POST /v1/messages, POST /v1/responses |
Endpoint declarations above merge all public tiers. To generate snippets tailored to your specific API key and tier, open the Documentation page. Live per-tier pricing is shown on the Models & Pricing page.
3. OpenAI Python & Node SDK
Set GROOROUTE_API_KEY in your environment and point base_url / baseURL at https://grooroute.com/v1:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://grooroute.com/v1",
api_key=os.environ["GROOROUTE_API_KEY"],
)
completion = client.chat.completions.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Hello"}],
)
print(completion.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: "https://grooroute.com/v1",
apiKey: process.env.GROOROUTE_API_KEY,
});
const completion = await client.chat.completions.create({
model: "deepseek-v4.1-flash",
messages: [{ role: 'user', content: 'Hello' }],
});
console.log(completion.choices[0].message.content);
4. Codex CLI (~/.codex/config.toml)
Codex CLI speaks the OpenAI Responses protocol (POST /v1/responses). Add a custom provider in ~/.codex/config.toml and export OPENAI_API_KEY:
model = "gpt-5.6-luna"
model_provider = "grooroute"
[model_providers.grooroute]
name = "GrooRoute"
base_url = "https://grooroute.com/v1"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
5. Claude Code (Shell Environment)
Export the root URL (https://grooroute.com, without /v1) and your GrooRoute Pro key before starting a new Claude Code session:
export ANTHROPIC_BASE_URL='https://grooroute.com'
export ANTHROPIC_AUTH_TOKEN='<your key>'
export ANTHROPIC_MODEL='claude-opus-5-5'
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-5-5'
export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-opus-5-5'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-opus-5-5'
claude --model 'claude-opus-5-5'
6. OpenCode (opencode.json)
Add a grooroute provider in your project's opencode.json and set GROOROUTE_API_KEY in your shell:
{
"$schema": "https://opencode.ai/config.json",
"model": "grooroute/deepseek-v4.1-flash",
"small_model": "grooroute/deepseek-v4.1-flash",
"provider": {
"grooroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "GrooRoute",
"options": {
"baseURL": "https://grooroute.com/v1",
"apiKey": "{env:GROOROUTE_API_KEY}"
},
"models": {
"deepseek-v4.1-flash": {
"name": "deepseek-v4.1-flash"
}
}
}
}
}
7. Service Tiers & Spend Controls
GrooRoute Pro organises supply into four service tiers — economy, balanced, high_quality, and self_operated — billed pay-as-you-go in USD with separate input and output rates. An Auto key falls back only to cheaper tiers when a tier is unavailable, or you can pin a single request with <model>:economy and, when a request is served in one of the four tiers, read the served tier from the X-GrooRoute-Tier response header.
Frequently Asked Questions
Should base_url include /v1?
Yes for OpenAI-compatible clients (OpenAI Python and Node SDKs, Codex CLI, OpenCode), which append /chat/completions or /responses. No for Claude Code, which appends /v1/messages itself and needs the root URL without /v1.
Which protocol endpoints are registered on GrooRoute Pro?
GrooRoute Pro registers POST /v1/chat/completions, POST /v1/responses, and POST /v1/messages. Which endpoints a specific model supports in your tier is shown on the Documentation page.
How does Auto tier fallback work?
An API key set to Auto walks from its selected top tier down to cheaper tiers when supply is unavailable, and never upgrades to a more expensive tier.
Where do I check live model availability and pricing?
Live model availability and per-tier USD rates (priced separately for input and output) are published on the Models & Pricing page.
Last updated: