Quotaflow
llms.txtOpenAPIDashboard
Quotaflow API

Switch from OpenRouter

When to use this page

Use this page when you already call OpenRouter — or any other OpenAI-compatible aggregator — and want the same code to run on Quotaflow. In every framework below the switch is the base URL and the key; nothing about your request or response handling changes.

Quotaflow model ids use the same OpenRouter-style author/model convention (anthropic/claude-sonnet-5, moonshotai/kimi-k3, z-ai/glm-5.2), so most ids carry over unchanged. Always confirm against GET /models with your key — the authenticated list is the final word on what your key can call.

The whole migration

# before
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="sk-or-..."
# after
export OPENAI_BASE_URL="https://api.quotaflow.ai/openai/v1"
export OPENAI_API_KEY="qf_your_key_here"

That is the entire change for every client that reads the standard OpenAI environment variables. The sections below show the same swap where the URL lives in code.

OpenAI SDK

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.quotaflow.ai/openai/v1", // was https://openrouter.ai/api/v1
  apiKey: process.env.QUOTAFLOW_API_KEY,
});

const reply = await client.chat.completions.create({
  model: "anthropic/claude-sonnet-5",
  messages: [{ role: "user", content: "Hello from Quotaflow" }],
});

The Python SDK is the same two constructor arguments: OpenAI(base_url="https://api.quotaflow.ai/openai/v1", api_key=os.environ["QUOTAFLOW_API_KEY"]).

Vercel AI SDK

import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";

const quotaflow = createOpenAICompatible({
  name: "quotaflow",
  baseURL: "https://api.quotaflow.ai/openai/v1",
  apiKey: process.env.QUOTAFLOW_API_KEY,
});

const { text } = await generateText({
  model: quotaflow("anthropic/claude-sonnet-5"),
  prompt: "Hello from the AI SDK",
});

Any model instance built this way drops into every AI SDK call site (streamText, generateObject, tool loops) and into routers built on AI SDK models — if you keep a cheapest-first router today, each provider entry becomes quotaflow("<model id>").

Mastra

Mastra agents take AI SDK model instances, so the provider above is the whole integration:

import { Agent } from "@mastra/core/agent";

const agent = new Agent({
  name: "assistant",
  instructions: "You are a helpful assistant.",
  model: quotaflow("anthropic/claude-sonnet-5"), // from the AI SDK snippet above
});

Anthropic SDK

Claude-shaped clients switch on the Anthropic-compatible surface instead — no /openai prefix:

export ANTHROPIC_BASE_URL="https://api.quotaflow.ai"
export ANTHROPIC_API_KEY="qf_your_key_here"

See Anthropic-compatible Messages for model ids, thinking support, and the error envelope.

What you can delete

On OpenRouter-style setups the client often carries a fallback list — several providers per logical model, ordered by price, with the client retrying across them. Quotaflow does that server-side: one model id is backed by multiple upstream suppliers with automatic failover, and billing is per model at the published rate whichever supplier serves the request. A single quotaflow("<model id>") entry replaces the per-provider list; keep your router only if you also route across platforms other than Quotaflow.

Check what your key serves

curl "https://api.quotaflow.ai/openai/v1/models" \
  -H "Authorization: Bearer $QUOTAFLOW_API_KEY"

Catalogs change, and a product-scoped key sees only its families. The default self-serve key is an all-model key: one credential for GPT/Codex, Claude, Gemini, GLM, Kimi, images, video, and embeddings, spending from one organization balance. See Base URL for the full endpoint mapping and Supported Models for the complete id matrix.