Skip to main content
Every request to Forii requires an API key via the Authorization header. API Key Management

API keys

API keys start with forii_sk_ and are created in the Dashboard.

Key types

TypePrefixScopeWhen to use
SDK keyforii_sk_...Full accessServer-side code, backend services
API keyforii_...Full accessAPI 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.
PlanRPM (requests per minute)TPM (tokens per minute)Status
Free60100K prompt / 10K completionAvailable now
Starter6001M prompt / 100K completionComing soon
Pro6,00010M prompt / 1M completionComing soon
EnterpriseCustomCustomComing 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.