Vertex AI Alternative Kenya: Fikra API Integration Guide
Introduction
Google Vertex AI is a managed machine learning platform that provides access to various AI models and infrastructure. For developers in Kenya seeking a local or regionally focused alternative for LLM integration, Fikra API offers an OpenAI-compatible endpoint. This guide explains how to integrate Fikra API as a drop-in replacement for OpenAI-style chat completions, without implying that Fikra hosts or resells Google's models.
Comparison: Vertex AI vs. Fikra API
| Feature | Google Vertex AI | Fikra API |
|---|---|---|
| Integration Style | Google Cloud SDK, REST, or Vertex AI-specific clients. | OpenAI-compatible SDK or standard HTTP requests. |
| Authentication | Google Cloud service accounts, OAuth 2.0, or API keys. | Bearer token (Authorization: Bearer fk_live_...). |
| Endpoint Compatibility | Vertex AI-specific endpoints. | OpenAI-style /chat/completions endpoint. |
| Payment/Access | Google Cloud billing (invoicing, credit cards). | Fikra dashboard with Paystack integration (M-Pesa and cards accepted). |
| Model Naming | Google model IDs (e.g., gemini-1.5-pro). |
Fikra aliases (e.g., fikra-flash, fikra-pro-20b). |
Python Example: Using Fikra API with OpenAI SDK
Fikra API supports OpenAI-style requests. You can use the official OpenAI Python SDK by pointing the base URL to Fikra's API endpoint.
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 is a suitable choice for developers who:
- Prefer OpenAI Compatibility: You want to use existing OpenAI SDK code with minimal changes by only updating the
base_urlandapi_key. - Need Local Payment Options: You require billing via M-Pesa or cards through Paystack, which is integrated into the Fikra dashboard.
- Seek Regional Access: You are based in Kenya and prefer a service with local infrastructure and support.
- Use Fikra Models: You specifically want to use Fikra's model aliases such as
fikra-flash,fikra-fast-8b,fikra-pro-20b, orfikra-pro-120b.
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 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-limit responses appropriately.
- API Key Security: Store your
FIKRA_API_KEYsecurely in environment variables or a secrets manager. Never hardcode keys in source code. - Billing Setup: Confirm that your Fikra dashboard has sufficient token credits and that your Paystack billing method is active.
- Streaming Support: If you use
stream: true, ensure your client can handle Server-Sent Events (SSE) correctly.
For the most up-to-date information on models, pricing, and limits, refer to the official Fikra API documentation at https://fikraapi.co.ke.
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.