Every request to Forii requires an API key via the Authorization header.
API keys
API keys start with forii_sk_ and are created in the Dashboard.
Key types
| Type | Prefix | Scope | When to use |
|---|
| SDK key | forii_sk_... | Full access | Server-side code, backend services |
| API key | forii_... | Full access | API management, programmatic access |
API keys are shown only once at creation time. Store them securely — in environment variables, not in source code.
Using your API key
Environment variable
export FORII_API_KEY="forii_sk_..."
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="https://api.forii.in/inference/v1",
api_key=os.environ["FORII_API_KEY"],
)
JavaScript (OpenAI SDK)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.FORII_API_KEY,
baseURL: "https://api.forii.in/inference/v1",
});
cURL
curl https://api.forii.in/inference/v1/chat/completions \
-H "Authorization: Bearer $FORII_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "forii/deepseek-v3", "messages": [...]}'
Key management
Create a key
curl -X POST https://api.forii.in/v1/accounts/{account_id}/apiKeys \
-H "Authorization: Bearer {session_token}" \
-H "Content-Type: application/json" \
-d '{"name": "prod-api"}'
{
"id": "key_abc123",
"name": "prod-api",
"key": "forii_sk_xxxxxxxxxxxxxxxxxxxxxxxx",
"created": "2025-01-15T10:30:00Z",
"status": "active"
}
List keys
curl https://api.forii.in/v1/accounts/{account_id}/apiKeys \
-H "Authorization: Bearer {session_token}"
Revoke a key
curl -X DELETE https://api.forii.in/v1/accounts/{account_id}/apiKeys/{key_id} \
-H "Authorization: Bearer {session_token}"
Currently, all keys have full access. Scoped keys (read-only, inference-only) are coming soon.
Rate limits
Forii is on the Free Plan today. Paid tiers are on the roadmap.
| Plan | RPM (requests per minute) | TPM (tokens per minute) | Status |
|---|
| Free | 60 | 100K prompt / 10K completion | Available now |
| Starter | 600 | 1M prompt / 100K completion | Coming soon |
| Pro | 6,000 | 10M prompt / 1M completion | Coming soon |
| Enterprise | Custom | Custom | Coming soon |
Rate limit headers are included in every response:
X-Ratelimit-Limit-Requests: 600
X-Ratelimit-Remaining-Requests: 543
X-Ratelimit-Reset: 1705312200
When you exceed rate limits, the API returns 429 Too Many Requests with a Retry-After header.