By Fikra DevRel • 4 min read

OpenAI Compatible API Endpoints: Fikra API Integration Guide

OpenAI Compatible API Endpoints: Fikra API Integration Guide

Introduction

OpenAI provides a widely adopted API structure for interacting with large language models. Many developers seek alternatives that maintain this familiar interface to reduce migration friction. Fikra API offers an OpenAI-style chat-completions endpoint, allowing you to use standard SDKs and request formats while accessing Fikra's specific model aliases. This guide explains how to integrate Fikra API as an OpenAI-compatible endpoint without implying that Fikra hosts or resells OpenAI's proprietary models.

Comparison: OpenAI API vs. Fikra API

The following table compares the integration characteristics of the external OpenAI service and Fikra API. Note that Fikra API is an independent provider; it does not host OpenAI models.

Feature OpenAI API (External Provider) Fikra API
Integration Style OpenAI SDK or raw HTTP requests to OpenAI base URL. OpenAI-style SDK or raw HTTP requests to Fikra base URL.
Authentication Authorization: Bearer sk-... (OpenAI API key). Authorization: Bearer fk_live_... (Fikra API key).
Endpoint Compatibility Native OpenAI endpoints. Compatible with OpenAI-style /chat/completions requests and responses.
Payment/Access OpenAI billing and account management. Fikra dashboard, token-credit wallet, and Paystack billing integration (M-Pesa and cards accepted).
Model Naming OpenAI model identifiers (e.g., gpt-4o). Fikra model aliases (e.g., fikra-flash, fikra-pro-20b).

Python Example Using OpenAI SDK

You can use the official OpenAI Python SDK to interact with Fikra API by overriding the base URL and providing your Fikra API key. Ensure you replace FIKRA_API_KEY with your actual key from the Fikra dashboard.

import os
from openai import OpenAI

# Initialize the client with Fikra's base URL and API key
client = OpenAI(
    base_url="https://api.fikraapi.co.ke/v1",
    api_key=os.getenv("FIKRA_API_KEY")
)

# Make a chat completion request using a Fikra model alias
response = client.chat.completions.create(
    model="fikra-flash",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello, Fikra!"}
    ]
)

print(response.choices[0].message.content)

When Fikra API is a Fit

Fikra API is a suitable choice if:

  • You want to use the familiar OpenAI SDK and request/response structure without changing your application logic significantly.
  • You prefer to access Fikra's specific model aliases (such as fikra-flash or fikra-pro-20b) through a standardized interface.
  • You are based in Kenya or prefer payment methods like M-Pesa and cards via Paystack, integrated into a token-credit wallet system.
  • You need a straightforward, OpenAI-compatible endpoint for prototyping or production workloads using Fikra's infrastructure.

Verify Before Production

Before deploying Fikra API in a production environment, please verify the following:

  • Model Availability: Check the Fikra model registry in your dashboard to confirm which aliases (e.g., fikra-flash, fikra-fast-8b, fikra-pro-20b, fikra-pro-120b) are currently enabled for your account.
  • Rate Limits: Unverified accounts are limited to 30 requests per minute (RPM), while trusted accounts are limited to 100 RPM. Ensure your application handles rate-limiting responses appropriately.
  • Billing and Credits: Confirm that your token-credit wallet has sufficient balance and that your billing method (M-Pesa or card) is correctly linked via Paystack.
  • Streaming Support: If you use stream: true, ensure your client can handle Server-Sent Events (SSE) as per the OpenAI-compatible specification.
  • Key Security: Store your FIKRA_API_KEY securely in environment variables or a secrets manager; never hardcode it in source code.

For the most up-to-date information on model availability, rate limits, and billing, refer to the Fikra dashboard and official documentation at https://fikraapi.co.ke.


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