ZeroFA provides an OpenAI-compatible REST API. Change only base_url and api_key in existing OpenAI SDK code to call every supported Claude, GPT, Gemini, DeepSeek, and Qwen model through one endpoint.
1. Get an API key
Open API Keys to create an sk-zerofa-* key and store it safely. The full secret is shown only once and cannot be recovered.
2. Fund your wallet
Every call is charged in configured currency from your Wallet in real time. The API wallet is separate from web chat subscriptions.
3. Make a request
Point base_url at ZeroFA and replace api_key with your key. Choose a language to get started:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://zerofa.ai/v1",
api_key=os.environ["FORNAI_API_KEY"], # Read from a server-side environment variable
)
resp = client.chat.completions.create(
model="your-chat-model-id", # Any model supported by ZeroFA
messages=[{"role": "user", "content": "hello"}],
)
print(resp.choices[0].message.content){
"id": "chatcmpl_...",
"object": "chat.completion",
"model": "your-chat-model-id",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "Hello!"},
"finish_reason": "stop"
}],
"usage": {"prompt_tokens": 8, "completion_tokens": 3, "total_tokens": 11}
}Verify the integration
After the first successful call, check these three signals before wiring in application logic.
- The response model matches the site model ID you requested. Switching models only changes model.
- The response contains token usage and the same call appears in the console call log.
- Keep the X-Request-ID response header. It is the primary lookup key for failed requests and billing investigations.
Supported models
Switch among dozens of Claude, GPT, Gemini, and DeepSeek models by changing only the model field. See the live list in the Model Catalog, or retrieve it with GET /v1/models.
Next steps
- Learn the console features: Console guide
- Review billing rules: Pricing and billing
- See all request fields: Chat Completions
- Use native provider formats: Anthropic Messages / Gemini generateContent