By Fikra DevRel • 4 min read

Bypass Stripe for AI APIs: Fikra API Payment Methods

Bypass Stripe for AI APIs: Fikra API Payment Methods

Payment Methods for Fikra API

Fikra API does not use Stripe for billing. Instead, it utilizes a token-credit wallet system integrated with Paystack.

What is a Token-Credit Wallet?

A token-credit wallet is a prepaid balance system where you purchase credits (tokens) that are deducted as you make API requests. This model separates payment processing from API usage, allowing for predictable cost management.

Supported Payment Methods

Fikra API publicly states that M-Pesa and cards are accepted for top-ups. These transactions are processed through the Paystack billing integration.

Note: If you are looking to use a specific payment method not listed here (such as direct bank transfers or other gateways), please confirm availability with Fikra support before attempting to use it.

Account and Top-Up Flow

  1. Access Dashboard: Log in to the Fikra dashboard at fikraapi.co.ke.
  2. Top Up Wallet: Navigate to the billing or wallet section to add credits using M-Pesa or a supported card.
  3. Generate API Key: Create or retrieve your API key (format: fk_live_...) from the dashboard.
  4. Use API: Make requests to the API using your key. Credits are deducted per token used.

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: - Check Balance: Regularly query your account balance via the dashboard or available API endpoints (if provided). - Handle 402 Errors: Implement retry logic or user notifications when a 402 response is received. Do not assume the request will succeed after a 402 error without topping up the wallet.

Security Advice

  • Never expose Fikra API keys in browser code. API keys should only be used in server-side environments.
  • Store your FIKRA_API_KEY in environment variables or a secure secrets manager.
  • Use the Authorization: Bearer fk_live_... header in server-side requests only.

Example: Server-Side Request (Python)

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, Fikra!"}
    ]
}

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 wallet.")
elif response.status_code == 200:
    print(response.json())
else:
    print(f"Error: {response.status_code} - {response.text}")

For the most up-to-date information on payment methods and wallet limits, refer to the Fikra dashboard or contact support.


JM
// The Founder

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.

usagestatusdashboard