Skip to main content
Anything that talks to the OpenAI API talks to OrcaRouter. The typical pattern: set the base URL to https://api.orcarouter.ai/v1 and use an sk-orca-... API key. Tools that use the Anthropic SDK (like Claude Code) point at https://api.orcarouter.ai instead — the Anthropic SDK appends /v1/messages itself.

LangChain

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="openai/gpt-4o",
    base_url="https://api.orcarouter.ai/v1",
    api_key="sk-orca-...",
)

LangChain.js

import { ChatOpenAI } from "@langchain/openai";

const model = new ChatOpenAI({
  model: "openai/gpt-4o",
  openAIApiKey: "sk-orca-...",
  configuration: { baseURL: "https://api.orcarouter.ai/v1" },
});

Vercel AI SDK

import { createOpenAI } from "@ai-sdk/openai";

const openai = createOpenAI({
  baseURL: "https://api.orcarouter.ai/v1",
  apiKey: "sk-orca-...",
});

const model = openai("openai/gpt-4o");

Claude Code (CLI)

export ANTHROPIC_API_KEY="sk-orca-..."
export ANTHROPIC_BASE_URL="https://api.orcarouter.ai"
claude  # points at OrcaRouter's /v1/messages endpoint
The Anthropic SDK that Claude Code uses appends /v1/messages itself, so the base URL should be the bare host (no /v1 suffix).

Codex CLI / OpenAI CLI

export OPENAI_API_KEY="sk-orca-..."
export OPENAI_BASE_URL="https://api.orcarouter.ai/v1"
codex
(Older OpenAI tools may use OPENAI_API_BASE instead of OPENAI_BASE_URL — set whichever your tool expects.)

Anything else

If the framework lets you override the OpenAI base URL or Anthropic base URL, it works with OrcaRouter. If the framework hardcodes the base URL, you can usually patch the client instance or set OPENAI_BASE_URL / ANTHROPIC_BASE_URL environment variables before import.