Shared API Pool Rate Limits Explained
Fikra API operates on a shared infrastructure pool. Rate limits are enforced per account to ensure fair usage across all clients. The current public limits are 30 requests per minute (RPM) for unverified accounts and 100 RPM for trusted accounts.
HTTP Status Codes
- 400 Bad Request: The request body is malformed, or the specified model alias is not supported. Verify your JSON structure and check the model registry for valid aliases (e.g.,
fikra-flash,fikra-pro-20b). - 401 Unauthorized: The
Authorizationheader is missing, the API key is invalid, or the key has been deactivated. Ensure you are using a validfk_live_...key from your Fikra dashboard. - 402 Payment Required: Your token-credit wallet balance is insufficient to process the request. Top up your wallet via the Fikra dashboard using Paystack (M-Pesa or cards).
- 429 Too Many Requests: You have exceeded the current RPM limit for your account tier. This is a shared pool limit, not a dedicated capacity reservation.
- 503 Service Unavailable: The upstream provider is temporarily unavailable. This is a transient error and does not indicate a permanent outage.
Handling 429 and 503 Errors
When encountering 429 or 503 responses, implement exponential backoff to avoid hammering the API. Do not assume automatic failover or dedicated capacity; these are shared pool resources.
import time
import random
import requests
base_url = "https://api.fikraapi.co.ke/v1"
api_key = "YOUR_FIKRA_API_KEY" # Use environment variable in production
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
payload = {
"model": "fikra-flash",
"messages": [{"role": "user", "content": "Hello"}]
}
def call_fikra_api():
max_retries = 5
backoff_factor = 1
for attempt in range(max_retries):
response = requests.post(f"{base_url}/chat/completions", headers=headers, json=payload)
if response.status_code == 200:
return response.json()
if response.status_code in [429, 503]:
# Exponential backoff with jitter
sleep_time = (2 ** attempt) * backoff_factor + random.uniform(0, 1)
print(f"Received {response.status_code}. Retrying in {sleep_time:.2f}s...")
time.sleep(sleep_time)
continue
# For other errors, do not retry
raise Exception(f"API Error: {response.status_code} - {response.text}")
raise Exception("Max retries exceeded for 429/503 errors.")
# Example usage
# result = call_fikra_api()
Notes
- Rate limits are enforced per API key.
- There is no guaranteed uptime SLA or dedicated capacity for shared pool users.
- Check the Fikra dashboard for your current account tier and wallet balance.
James Miano
CTO & ML Engineer at Lacesse Ventures. James specializes in low-overhead LLM quantization processes, custom ternary weights architectures, and localized server optimization.
Stop paying for overpriced round-trip latency
Why route queries over Western servers when you can use low-overhead hardware located in Nairobi? Save 87% on your monthly inference spend. No minimum credit limits. M-Pesa ready.