Set up your coding agent
StrataCode speaks the OpenAI API. Any tool that lets you set a base URL and an API
key works — you keep your workflow and swap only where the tokens come from.
Use stratacode/auto to let the router pick the cheapest model that can
handle each turn.
The two values you need
Base URL
https://api.stratacode.ai/v1
Model
stratacode/auto — or pin one from the catalog.
Environment (works with most tools)
export OPENAI_BASE_URL="https://api.stratacode.ai/v1"export OPENAI_API_KEY="sk_your_key_here"Per-tool setup
In the provider settings, choose OpenAI Compatible and set:
Base URL: https://api.stratacode.ai/v1API Key: sk_your_key_hereModel ID: stratacode/auto{ "provider": { "stratacode": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://api.stratacode.ai/v1", "apiKey": "sk_your_key_here" } } }, "model": "stratacode/auto"}Or just run stc login — it writes this for you.
Point the Anthropic-compatible base URL at StrataCode:
export ANTHROPIC_BASE_URL="https://api.stratacode.ai"export ANTHROPIC_API_KEY="sk_your_key_here"Anthropic-compatible ingress is rolling out — check the docs for current status.
from langchain_openai import ChatOpenAI
llm = ChatOpenAI( base_url="https://api.stratacode.ai/v1", api_key="sk_your_key_here", model="stratacode/auto",)import { createOpenAICompatible } from "@ai-sdk/openai-compatible"
const stratacode = createOpenAICompatible({ name: "stratacode", baseURL: "https://api.stratacode.ai/v1", apiKey: process.env.STRATACODE_API_KEY,})
const model = stratacode("stratacode/auto")Why auto
stratacode/auto scores each request and routes simple turns to a cheaper model,
hard turns to the full model, and escalates automatically if a cheap answer looks
incomplete. The response tells you which model actually answered, and you’re
billed at that model’s rate. See how routing works.