Overview
Fikra API is an OpenAI-compatible AI inference API for developers and growing AI teams who need production inference without a credit-card gate. You can use its chat completions endpoint to turn raw YouTube transcripts into clean, well-structured notes, including translation when needed. The endpoint accepts OpenAI-style requests and responses, and streaming is supported.
Prerequisites
- A Fikra API key stored in an environment variable named
FIKRA_API_KEY. - Python with the
openaiSDK installed. - The raw YouTube transcript text you want to translate and clean up.
Step-by-step
- Configure the OpenAI SDK to use Fikra API's base URL:
https://api.fikraapi.co.ke/v1. - Send a chat completion request to
POST https://api.fikraapi.co.ke/v1/chat/completions. - Use a model from your pricing plan, for example
deepseek-v4-flash-0731. - Provide a prompt that asks for translation and clean notes, then include the transcript.
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.fikraapi.co.ke/v1",
api_key=os.environ["FIKRA_API_KEY"],
)
transcript = "Your raw YouTube transcript here"
response = client.chat.completions.create(
model="deepseek-v4-flash-0731",
messages=[
{
"role": "system",
"content": "Translate the transcript into clean, well-organized notes.",
},
{"role": "user", "content": transcript},
],
)
print(response.choices[0].message.content)
Verify it works
The response is returned in the standard OpenAI chat completion format. Check response.choices[0].message.content for the cleaned notes. If the request fails, confirm your API key is active, that the model name is supported, and that you are within your rate limits.
Costs
Pricing is per 1M tokens and varies by model. For example, deepseek-v4-flash-0731 costs $0.09 per 1M input tokens and $0.15 per 1M output tokens. Other models such as deepseek-v4.1-flash, fikra-auto, and fikra-code-35b have different rates. Payment is handled through a token-credit wallet with M-Pesa and card top-ups via Paystack, and x402 USDC on Base for agents. For exact current rates, check the pricing page.
Common errors
- 401 , The API key is invalid, inactive, or missing.
- 400 , The requested model is unsupported or the request format is invalid.
- 429 , You have hit the rate limit: 30 requests/min for unverified accounts, 100 requests/min for trusted accounts.
- 503 , The upstream service is busy. Retry the request with backoff.