Firmrock
  • Solutions
  • Models
  • Rankings
  • Docs
  • Resources
  • 中文
  • English
Console

Docs · Quickstart

Your first call,in three minutes

It's OpenAI-compatible. Get an API key, point the base URL at Firmrock, and you can use 700+ models. Python, Node.js or curl.

Get an API key
The three things you need
base_url = "https://firmrock.ai/v1"  # base URLapi_key  = "your API key"  # from the consolemodel    = "anthropic/claude-sonnet"  # provider/model
The rest of your code stays the same.

Three steps

From zero to the first reply

  1. 01

    Get an API key

    Click “Get an API key” and create one in the console. Keep it in an environment variable, not in your code.

    Terminal
    export FIRMROCK_API_KEY="your API key"  # the code below reads it
  2. 02

    Change the base URL

    Already using an OpenAI SDK? Change the URL and the key, nothing else. To leave, change the URL back.

    The two lines to change, in each version
    # Pythonbase_url="https://firmrock.ai/v1",api_key=os.environ["FIRMROCK_API_KEY"], // Node.jsbaseURL: "https://firmrock.ai/v1",apiKey: process.env.FIRMROCK_API_KEY, # curlcurl https://firmrock.ai/v1/chat/completions-H "Authorization: Bearer $FIRMROCK_API_KEY"
    Not using an OpenAI SDK? The full code is below.
  3. 03

    Send your first request

    Pick one of the three versions below and run it. When you see the model's reply, you're done.

Full code

Your first request, three ways

All three send the same request. Copy and run.

  1. 01

    Python

    Uses the official OpenAI Python SDK. Install the openai package first.

    Run · Python
    # pip install openai import osfrom openai import OpenAI client = OpenAI(    base_url="https://firmrock.ai/v1",  # point here    api_key=os.environ["FIRMROCK_API_KEY"],  # your key) reply = client.chat.completions.create(    model="anthropic/claude-sonnet",    messages=[{"role": "user", "content": "Hello"}],)print(reply.choices[0].message.content)
  2. 02

    Node.js

    Uses the official OpenAI Node.js SDK. Install the openai package first, and save the file as .mjs.

    Run · Node.js
    // npm install openai import OpenAI from "openai"; const client = new OpenAI({  baseURL: "https://firmrock.ai/v1",  apiKey: process.env.FIRMROCK_API_KEY,}); const reply = await client.chat.completions.create({  model: "anthropic/claude-sonnet",  messages: [{ role: "user", content: "Hello" }],});console.log(reply.choices[0].message.content);
  3. 03

    curl

    Nothing to install. Send it straight from your terminal.

    Run · curl
    curl https://firmrock.ai/v1/chat/completions \  -H "Authorization: Bearer $FIRMROCK_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "anthropic/claude-sonnet",    "messages": [{"role": "user", "content": "Hello"}]  }'

After your first call

What you'll use next

Switch models by changing modelChange anthropic/claude-sonnet to openai/gpt. The URL, the key and the rest of your code stay the same. One key reaches 700+ models from 100+ providers.
Every call is recordedWhere it went first, why it moved, who answered, how much it used and what it cost, all in the dashboard.
→
No retry codeOn a timeout or a 5xx, the request moves to the next provider within the same call, in under 20 ms. Failed requests are free.
→
Put limits on a keyEach key has its own budget, concurrency limit and allowed models. It stops at the limit and warns you before it gets there.
→

FAQ

Questions on the first connection

Do I need a new SDK?+

No. It's OpenAI-compatible, so the OpenAI SDK works. Change the URL and the key.

What do I change to switch models?+

Only the model parameter. The URL and the key stay the same.

Do I need to write retries?+

No. On a timeout or a 5xx, the request moves to the next provider within the same call, in under 20 ms. Failed requests are free.

How am I charged?+

No monthly fee, pay for what you use. Each call is billed on its own, and the bill traces back to keys and requests.

What if I overspend while testing?+

Set a budget on the key. It stops at the limit and warns you before it gets there.

What if I want to go back?+

Change the URL and the key back. Nothing else in your code changes.

Get started

Get a key, send your first request

No monthly fee. Pay for what you use.

Get an API keySee how failover works

Firmrock

Firmrock
  • 中文
  • English
© 2026 Firmrock

Solutions

  • AI Gateway
  • Data Security
  • Coding Agents

Models & pricing

  • All Models
  • Pricing
  • Model Rankings

Resources

  • Developer Docs
  • Latest Posts
  • Status

Product

  • Auto Failover
  • Usage Insights
  • Spend Control
  • Integrations
  • Access & Audit