By Fikra DevRel • 4 min read

Mistral API Alternative: Using Fikra API as an OpenAI-Style Endpoint

Mistral API Alternative: Using Fikra API as an OpenAI-Style Endpoint

Introduction

Mistral AI is an external provider that offers its own suite of large language models and API services. Fikra API is a separate platform that provides access to its own set of models (such as fikra-flash, fikra-fast-8b, fikra-pro-20b, and fikra-pro-120b) through an OpenAI-compatible interface.

This page explains how a developer might use Fikra API as an alternative integration point if they prefer an OpenAI-style request/response structure, without implying that Fikra hosts or resells Mistral's models.

Comparison: Mistral API vs. Fikra API

Feature Mistral API (External) Fikra API
Integration Style Proprietary SDKs and REST endpoints. OpenAI-style chat-completions requests and responses.
Authentication Bearer token using Mistral API keys. Authorization: Bearer fk_live_... using Fikra API keys.
Endpoint Compatibility Mistral-specific endpoints. POST /chat/completions at https://api.fikraapi.co.ke/v1.
Payment/Access Mistral billing and account management. Fikra dashboard, token-credit wallet, and Paystack billing (M-Pesa and cards accepted).
Model Naming Mistral model identifiers (e.g., mistral-large). Fikra aliases (e.g., fikra-flash, fikra-pro-120b).

Python Example Using OpenAI SDK

Because Fikra API supports OpenAI-style chat-completions, you can use the standard openai Python SDK by pointing the base URL to Fikra's endpoint. Ensure you have a Fikra API key stored in an environment variable.

import os
from openai import OpenAI

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

# Use a listed Fikra model alias
response = client.chat.completions.create(
    model="fikra-flash",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello, how are you?"}
    ]
)

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

When Fikra API Is a Fit

Fikra API may be a suitable choice for developers who:

  • Prefer an OpenAI-compatible interface for easier integration with existing tools or libraries.
  • Are based in or operate within regions where Paystack billing (including M-Pesa) is convenient.
  • Want to use Fikra's specific model aliases (fikra-flash, fikra-fast-8b, fikra-pro-20b, fikra-pro-120b) for their use cases.
  • Require streaming support via Server-Sent Events (stream: true).

Verify Before Production

Before deploying Fikra API in a production environment, please:

  1. Check the Model Registry: Confirm that the specific Fikra model alias you intend to use is currently available and enabled for your account.
  2. Review Rate Limits: Note that current code enforces 30 RPM for unverified accounts and 100 RPM for trusted accounts. Ensure your application's traffic patterns align with these limits.
  3. Test Authentication: Verify that your FIKRA_API_KEY is correctly configured and that your account has sufficient token credits.
  4. Validate Streaming: If you rely on streaming, test the Server-Sent Events implementation in your specific environment.

Note: Fikra API does not host or resell Mistral AI models. For Mistral-specific models, please use the Mistral API directly.


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