Paying for Fikra API Credits with M-Pesa and Cards
Payment Methods and Token-Credit Wallet
Fikra API operates on a token-credit wallet system. Developers purchase credits to use Fikra models, such as fikra-flash or fikra-pro-20b. The platform integrates with Paystack for billing, and public documentation states that M-Pesa and card payments are accepted.
Note on "Llama 3": Fikra API currently lists specific model aliases (e.g., fikra-flash, fikra-fast-8b, fikra-pro-20b, fikra-pro-120b). If you are looking to pay for a specific external model like Llama 3, please confirm its availability in the Fikra model registry, as Fikra does not publicly list third-party models like Llama 3 in its current public alias list. Payment is for Fikra API credits, which are consumed by the models you call.
Account and Top-Up Flow
- Access Dashboard: Log in to the Fikra dashboard at fikraapi.co.ke.
- Generate API Key: Create a new API key (format:
fk_live_...) for your application. - Top Up Wallet: Navigate to the billing section to add credits. You can use M-Pesa or a card via the Paystack integration.
- Verify Balance: Ensure your token-credit balance is sufficient before making API calls.
Monitoring Balance and Handling HTTP 402
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.
Best Practices:
- Pre-check Balance: Query your account balance via the dashboard or API (if available) before high-volume requests.
- Handle 402 Errors: Implement retry logic or user notifications when a 402 response is received. Do not retry immediately without topping up the wallet.
- Rate Limits: Note that unverified accounts are limited to 30 RPM, while trusted accounts are limited to 100 RPM. Ensure your application respects these limits to avoid additional errors.
Security Advice
- Never Expose API Keys in Browser Code: Fikra API keys (
fk_live_...) must be stored securely on your server or in environment variables (e.g.,FIKRA_API_KEY). Never include them in client-side JavaScript, HTML, or mobile app code. - Use Environment Variables: Load your API key from an environment variable in your backend code.
Example: Secure API Call
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.")
base_url = "https://api.fikraapi.co.ke/v1"
endpoint = f"{base_url}/chat/completions"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
payload = {
"model": "fikra-flash",
"messages": [
{"role": "user", "content": "Hello, Fikra!"}
]
}
try:
response = requests.post(endpoint, headers=headers, json=payload)
if response.status_code == 402:
print("Error: Insufficient token credits. Please top up your wallet.")
elif response.status_code == 200:
print(response.json())
else:
print(f"Error: {response.status_code} - {response.text}")
except Exception as e:
print(f"Request failed: {e}")
Confirmation for Specific Models
If you intend to use a model not listed in the current public aliases (such as Llama 3), please contact Fikra support or check the model registry in the dashboard to confirm availability and pricing before making payment.
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.