For buyers
OpenAI-compatible API migration guide for Python, Node.js, and curl
Use an OpenAI-compatible API by changing the base URL and API key. Includes migration steps for Python, Node.js, streaming, and tool calling checks.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use an OpenAI-compatible API by changing the base URL and API key. Includes migration steps for Python, Node.js, streaming, and tool calling checks.
https://rockapi.ai/v1
from openai import OpenAI
client = OpenAI(
base_url="https://rockapi.ai/v1",
api_key="YOUR_ROCK_API_KEY",
)
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello from Rock API"}],
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://rockapi.ai/v1",
apiKey: process.env.ROCK_API_KEY,
});
const response = await client.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello from Rock API" }],
});
console.log(response.choices[0].message.content);
| Step | What to verify |
|---|---|
| Change the base URL | Point the SDK to https://rockapi.ai/v1. |
| Replace the API key | Use a Rock API key instead of a provider key. |
| Confirm model names | Use model IDs enabled in your Rock API account. |
| Test streaming | Set stream: true and confirm SSE handling. |
| Check tool calling | Test the exact tool or function call paths your app uses. |
| Review billing | Confirm token usage appears in your dashboard. |
