Developer Docs › Quickstart

Quickstart

Create an API key and send your first request with cURL, Python or Node.js.

1. Create an API key

Log in to the console, open the "API Keys" page and click "Create Key":

  • Groups: choose which routes this key uses (you can pick several; the ones listed first take priority). If unsure, start with a general-purpose group — you can change it any time.
  • Quota: set a cap, or leave it unlimited (charged to your account balance).
  • After creating it, copy the key that starts with sk-. The key is effectively a payment credential for your account balance — never share it or commit it to a code repository.

We recommend storing the key in an environment variable:

Shell

export API_KEY="sk-xxxxxxxxxxxxxxxx"

2. Send your first request

The examples below call gpt-5.5 via the OpenAI-compatible protocol. Swap model for any text model in the model catalog — including Claude, Gemini and DeepSeek — and it works as is.

cURL

curl https://api.onefast.ai/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Python

# pip install openai
import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["API_KEY"], base_url="https://api.onefast.ai/v1")

resp = client.chat.completions.create(
    model="gpt-5.5",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

Node.js

// npm install openai
import OpenAI from "openai";

const client = new OpenAI({ apiKey: process.env.API_KEY, baseURL: "https://api.onefast.ai/v1" });

const resp = await client.chat.completions.create({
  model: "gpt-5.5",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);

Example response:

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "gpt-5.5",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Hello! How can I help you today?" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 9, "completion_tokens": 10, "total_tokens": 19 }
}

3. Turn on streaming

Add "stream": true to receive output token by token (SSE). To get usage at the end of the stream, also add "stream_options": {"include_usage": true}.

Python

stream = client.chat.completions.create(
    model="gpt-5.5",
    messages=[{"role": "user", "content": "Tell me a short story about the sea"}],
    stream=True,
    stream_options={"include_usage": True},
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Next steps