Skip to main content
This guide takes you to your first successful request to OpenAI / Claude / Gemini through FortAPI in 3 steps.

Step 1. Create an API key

In the dashboard, go to TokensCreate token.
  • Name: anything for your own reference, e.g. local-dev.
  • Expiry: leave “Never” unless you need otherwise.
  • Spend limit: you can cap the token at a USD amount.
Copy the resulting key — it starts with sk-.... It’s best to save it right away, but if you lose it you can always return to the Tokens page in the dashboard and reveal it via the eye icon, or use “Copy key” to copy the full key again.

Step 2. First request

FortAPI is OpenAI-compatible. Use your favourite SDK and just swap the base_url:
from openai import OpenAI

client = OpenAI(
    api_key="sk-YOUR_KEY",
    base_url="https://www.fortapi.com/v1",
)

response = client.chat.completions.create(
    model="your-model-name",  # see the pricing page on the main site for available model names
    messages=[{"role": "user", "content": "Hello!"}],
)

print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "sk-YOUR_KEY",
  baseURL: "https://www.fortapi.com/v1",
});

const response = await client.chat.completions.create({
  model: "your-model-name", // see the pricing page on the main site for available model names
  messages: [{ role: "user", content: "Hello!" }],
});

console.log(response.choices[0].message.content);
# replace "your-model-name" with any model name from the pricing page
curl https://www.fortapi.com/v1/chat/completions \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model-name",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
Replace your-model-name with any model name from the pricing page on the main site.

Step 3. Switch models

To switch to Claude, Gemini, Grok or any other provider, change only the model parameter:
model="your-model-name"  # see the pricing page on the main site for available model names
The full list of available models is on the Pricing page on the main site.

What’s next