Integrations
Exact settings to use your key in coding agents, chat apps, frameworks and automation tools.
Almost every tool that speaks OpenAI's API can use this one. You need three values:
| Setting | Value |
|---|---|
| Base URL (OpenAI format) | https://pinerouter.ai/v1 |
| Base URL (Anthropic format) | https://pinerouter.ai |
| API key | A key from API keys, starting with sk- |
| Model | An id from Models, for example gpt-5-2 |
Use one key per tool, so you can limit or delete one without touching the others. Setting labels below are taken from each tool's own docs; they can move between versions.
Coding agents
Claude Code
export ANTHROPIC_BASE_URL="https://pinerouter.ai"
export ANTHROPIC_AUTH_TOKEN="sk-..."
export ANTHROPIC_MODEL="gpt-5-2"Full guide: Claude Code.
Codex CLI
# ~/.codex/config.toml
model = "gpt-5-5"
model_provider = "ai"
[model_providers.ai]
name = "AI"
base_url = "https://pinerouter.ai/v1"
env_key = "AI_API_KEY"
wire_api = "responses"Full guide: Codex CLI.
Cursor
In Cursor Settings > Models, paste your key in the OpenAI API Key field, turn on the base URL override and set it to https://pinerouter.ai/v1, then add a model id such as gpt-5-2 by hand. Cursor uses your own key for chat models only; Tab completion stays on Cursor's models. Cursor sends these requests from its own servers.
Cline, Roo Code
API Provider: OpenAI Compatible, then:
| Field | Value |
|---|---|
| Base URL | https://pinerouter.ai/v1 |
| API Key | sk-... |
| Model | gpt-5-2 |
Kilo Code
Add a custom provider: Provider API OpenAI Compatible, Base URL https://pinerouter.ai/v1, API key sk-..., then add model ids under Models (or pick from the fetched list).
opencode
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ai": {
"npm": "@ai-sdk/openai-compatible",
"name": "AI",
"options": { "baseURL": "https://pinerouter.ai/v1", "apiKey": "{env:API_KEY}" },
"models": { "gpt-5-2": { "name": "GPT 5.2" } }
}
}
}Save it as opencode.json in your project.
Chat apps
Cherry Studio, CC Switch, DeepChat
Step-by-step guides: Cherry Studio, CC Switch, DeepChat.
LobeChat (self-hosted)
OPENAI_API_KEY=sk-...
OPENAI_PROXY_URL=https://pinerouter.ai/v1Open WebUI
OPENAI_API_BASE_URL=https://pinerouter.ai/v1
OPENAI_API_KEY=sk-...Or add the same URL and key as an OpenAI API connection in the admin settings under Connections.
Chatbox
Settings > Model Provider > Add, type OpenAI API compatible:
| Field | Value |
|---|---|
| API Host | https://pinerouter.ai |
| API Path | Leave empty (defaults to /v1/chat/completions) |
| API Key | sk-... |
Add at least one model id, save and click Check.
Frameworks
Vercel AI SDK
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";
const ai = createOpenAICompatible({ name: "ai", baseURL: "https://pinerouter.ai/v1", apiKey: process.env.API_KEY });
const { text } = await generateText({ model: ai("gpt-5-2"), prompt: "Hello" });LangChain
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-5-2", base_url="https://pinerouter.ai/v1", api_key="sk-...")
print(llm.invoke("Hello").content)ChatOpenAI reads only fields in OpenAI's standard format, so model-specific extras in answers are dropped.
LlamaIndex
# pip install llama-index-llms-openai-like
from llama_index.llms.openai_like import OpenAILike
llm = OpenAILike(model="gpt-5-2", api_base="https://pinerouter.ai/v1", api_key="sk-...",
is_chat_model=True, context_window=128000)Set context_window to the model's real context length.
LiteLLM
import litellm
r = litellm.completion(model="openai/gpt-5-2", api_base="https://pinerouter.ai/v1", api_key="sk-...",
messages=[{"role": "user", "content": "Hello"}])The openai/ prefix tells LiteLLM to use the OpenAI format; the part after it is our model id.
Automation
n8n
Create an OpenAI credential: API Key sk-..., Base URL https://pinerouter.ai/v1. Use it in the OpenAI and Chat OpenAI nodes and type the model id.
Dify
Install the OpenAI-API-compatible model provider, then add a model: Model Name gpt-5-2, API Key sk-..., API endpoint URL https://pinerouter.ai/v1.
Flowise
Use the ChatOpenAI node with an OpenAI credential holding your key, set Model Name to an id such as gpt-5-2, and under Additional Parameters set Base Path to https://pinerouter.ai/v1.
MCP clients
Claude.ai, ChatGPT, Claude Code, Codex, Cursor and other MCP clients can call the media and text models as tools through https://pinerouter.ai/mcp, with sign-in or your key. See MCP.
Media models in these tools
These tools speak the text formats. For images, video, music and speech with every setting, call Jobs from your code, or use the MCP tools above.
