Get started
- Create an account at /register. A free account is enough to try the API.
- Create an API key on the API keys page. The full key is shown once, so copy it somewhere safe.
- Send a request to the base URL below with your key in the
Authorizationheader.
Base URL
https://onerate.cloud/v1
Enterprise and team plans may be given a dedicated relay endpoint. Your plan page shows the exact base URL for your account.
Authentication
Send your key as a Bearer token on every request:
Authorization: Bearer YOUR_ONERATE_API_KEY
Examples
A chat completion in curl, Python (official openai package) and JavaScript (official openai npm package):
curl https://onerate.cloud/v1/chat/completions \
-H "Authorization: Bearer $ONERATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello from One Rate"}]
}'
from openai import OpenAI
client = OpenAI(
base_url="https://onerate.cloud/v1",
api_key="YOUR_ONERATE_API_KEY",
)
resp = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello from One Rate"}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://onerate.cloud/v1",
apiKey: process.env.ONERATE_API_KEY,
});
const resp = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello from One Rate" }],
});
console.log(resp.choices[0].message.content);
Streaming
Set "stream": true to receive server-sent events in the standard OpenAI format, token by token.
stream = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Write a haiku"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")
Models
List the models your key can use:
curl https://onerate.cloud/v1/models -H "Authorization: Bearer $ONERATE_API_KEY"
Pass any returned id as the model field. A key can be limited to a subset of models; then only those are listed.
Errors & limits
| Status | Meaning | What to do |
|---|---|---|
401 | Missing, wrong or revoked key | Check the Authorization header and the key's status. |
403 | Request from an IP the key doesn't allow, a model outside the key's list, or a paused account | Update the key's IP allow list or model list, or check your plan. |
429 | Rate limit or plan quota reached | Retry with backoff, or move to a plan with more capacity. |
5xx | Upstream model or gateway problem | Retry with backoff and check the status page. |
Tools & SDKs
Anything that lets you set an OpenAI base URL works: the OpenAI SDKs, LangChain, LlamaIndex, Vercel AI SDK, Open WebUI, Continue, Cursor and similar tools. Use https://onerate.cloud/v1 as the base URL and your One Rate key as the API key.