By Fikra DevRel • 4 min read

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

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

Introduction

OctoAI is an external provider that offers inference services for various large language models. Developers looking for alternatives often seek platforms that offer familiar integration patterns, such as OpenAI-compatible APIs, to reduce migration friction.

Fikra API provides an OpenAI-style chat-completions endpoint. It does not host, resell, or provide OctoAI's models. Instead, Fikra offers its own set of model aliases (such as fikra-flash and fikra-pro-20b) through a standardized interface. This page explains how to integrate with Fikra API using standard OpenAI SDK patterns.

Comparison: OctoAI vs. Fikra API

Feature OctoAI (External Provider) Fikra API
Integration Style Proprietary or provider-specific SDKs/APIs. OpenAI-style chat-completions requests and responses.
Authentication Provider-specific API keys. Authorization: Bearer fk_live_... header.
Endpoint Compatibility Varies by OctoAI service. POST /chat/completions at https://api.fikraapi.co.ke/v1.
Payment/Access Varies by OctoAI billing model. Token-credit wallet with Paystack billing integration (M-Pesa and cards accepted).
Model Naming OctoAI-specific model identifiers. Fikra aliases (e.g., fikra-flash, fikra-fast-8b, fikra-pro-20b, fikra-pro-120b).

Python Example: Using Fikra API with OpenAI SDK

You can use the standard OpenAI Python SDK to interact with Fikra API by specifying the Fikra base URL and API key. Ensure you have installed the openai package.

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, 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 OpenAI Compatibility: You want to use the standard OpenAI SDK and request/response formats without writing custom integration code.
  • Need Local Payment Options: You are based in Kenya or prefer using M-Pesa or card payments via Paystack for API credits.
  • Require Specific Fikra Models: You are interested in using Fikra's specific model aliases like fikra-flash or fikra-pro-120b.
  • Want a Simple Authentication Flow: You prefer a straightforward Bearer token authentication scheme.

Verify Before Production

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

  1. Model Availability: Check the Fikra dashboard or model registry to confirm that the specific model alias you intend to use is currently available and enabled for your account.
  2. Rate Limits: Unverified accounts are limited to 30 requests per minute (RPM), while trusted accounts are limited to 100 RPM. Ensure your application's traffic patterns fit within these limits.
  3. Credit Balance: Monitor your token-credit wallet to ensure sufficient balance for your expected usage.
  4. Streaming Support: If you require real-time responses, test the stream: true parameter to ensure Server-Sent Events (SSE) work correctly in your environment.
  5. No SLA Guarantees: Fikra API does not currently publish uptime SLAs or support-response guarantees. Plan your architecture accordingly if high availability is critical.

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