How to Pay for AI APIs in Kenya: Fikra API Guide
Overview
Fikra API provides access to AI models through a token-credit wallet system. For developers in Kenya, Fikra supports billing via Paystack integration, with public messaging confirming that M-Pesa and card payments are accepted.
Token-Credit Wallet
A token-credit wallet is a prepaid balance system where you purchase credits that are deducted as you consume API tokens. This model allows for predictable cost management and immediate access to API services once funds are added.
Account and Top-Up Flow
- Access Dashboard: Log in to the Fikra dashboard at https://fikraapi.co.ke.
- Generate API Key: Create a new API key (format:
fk_live_...) for your project. - Top Up Wallet: Navigate to the billing section to add funds. Fikra uses Paystack for processing, supporting M-Pesa and card payments.
- Verify Balance: Ensure your token-credit balance is sufficient before making API calls.
Monitoring Balance and Handling Errors
Developers should monitor their token-credit balance to avoid service interruptions. If your balance is insufficient, the API will return an HTTP 402 (Payment Required) status code. Implement error handling in your application to detect this status and prompt users or administrators to top up their wallet.
Security Best Practices
- Never expose API keys in browser code: Keep your
FIKRA_API_KEYsecure on the server side. Exposing keys in client-side JavaScript allows anyone to use your credits. - Use environment variables: Store your API key in environment variables (e.g.,
FIKRA_API_KEY) rather than hardcoding it in source files. - Rotate keys: If a key is compromised, generate a new one immediately from the Fikra dashboard.
Important Notes
- Fikra does not offer direct payment APIs for third-party services.
- Exact exchange rates, minimum deposit amounts, and subscription pricing are not publicly specified. Check the Fikra dashboard for current billing details.
- Refund policies and payment availability in specific countries should be confirmed with Fikra support before use.
Example: Secure API Usage
import os
import requests
# Load API key from environment variable
api_key = os.environ.get("FIKRA_API_KEY")
if not api_key:
raise ValueError("FIKRA_API_KEY environment variable is not set")
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
payload = {
"model": "fikra-flash",
"messages": [{"role": "user", "content": "Hello"}]
}
response = requests.post(
"https://api.fikraapi.co.ke/v1/chat/completions",
headers=headers,
json=payload
)
if response.status_code == 402:
print("Insufficient balance. Please top up your Fikra wallet.")
elif response.status_code == 200:
print(response.json())
else:
print(f"Error: {response.status_code} - {response.text}")
For the most accurate and up-to-date information on payment methods, pricing, and account limits, always refer to the Fikra dashboard or contact Fikra support directly.
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.