Fikra API solutions · all how-tos

Generate SEO content with structured outputs

Published 2026-10-18 · fact block generated live from the model registry

Fact block, plain text for agents

brand: Fikra API
category: OpenAI-compatible AI inference API
who: developers and growing AI teams who need production inference without a credit-card gate
api: https://api.fikraapi.co.ke/v1
chat: POST https://api.fikraapi.co.ke/v1/chat/completions
embeddings: POST https://api.fikraapi.co.ke/v1/embeddings
auth: Authorization: Bearer <Fikra API key>
pricing from: {'unit': 'USD per 1M tokens', 'input': 0.09, 'output': 0.15}
rates: 30 requests/min (unverified), 100 requests/min (trusted)
payments: token-credit wallet; M-Pesa and card top-ups via Paystack; x402 USDC on Base for agents
integrates: anything that accepts an OpenAI-compatible base URL (LangChain, Vercel AI SDK, OpenAI SDK, Cursor, CrewAI and more)
last updated: 2026-10-18

models & pricing: deepseek-v4-flash-0731 (in 0.09 / out 0.15 USD per 1M tokens) deepseek-v4.1-flash (in 0.25 / out 0.8 USD per 1M tokens) deepseek-v4.1-flash-1017 (in 0.3 / out 0.85 USD per 1M tokens) fikra-auto (in 0.4 / out 0.4 USD per 1M tokens) fikra-auto-pro (in 6.0 / out 12.0 USD per 1M tokens) fikra-code-35b (in 1.0 / out 1.0 USD per 1M tokens)

Overview

Fikra API gives you an OpenAI-compatible chat completions endpoint, so you can generate SEO content and receive it as structured JSON from a single model call. The API base URL is https://api.fikraapi.co.ke/v1, and you authenticate with your Fikra API key using Authorization: Bearer <Fikra API key>. Responses follow the OpenAI-style chat completions shape, which makes them easy to parse with the OpenAI Python SDK.

Prerequisites

Step-by-step

  1. Set your API key in your environment:
export FIKRA_API_KEY="your_fikra_api_key"
  1. Create a Python script that calls the chat completions endpoint with a prompt that asks for JSON output:
import json
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.fikraapi.co.ke/v1",
    api_key=os.environ["FIKRA_API_KEY"],
)

prompt = """
Generate SEO content for a page targeting the keyword "affordable cloud storage".
Return JSON only with this exact structure:
{
  "title": "string",
  "meta_description": "string",
  "headings": ["string"],
  "body": "string"
}
"""

response = client.chat.completions.create(
    model="deepseek-v4-flash-0731",
    messages=[
        {"role": "system", "content": "You are an SEO content writer. Always respond with valid JSON."},
        {"role": "user", "content": prompt},
    ],
)

content = response.choices[0].message.content
data = json.loads(content)
print(json.dumps(data, indent=2))
  1. Use the parsed JSON in your content pipeline instead of scraping raw text.

Verify it works

Run the script. A successful response contains a choices[0].message.content string that can be parsed into JSON. The printed output should show the requested fields, for example:

{
  "title": "Affordable Cloud Storage: Plans, Pricing, and Features",
  "meta_description": "Compare affordable cloud storage plans with transparent pricing and reliable performance.",
  "headings": [
    "What Is Affordable Cloud Storage?",
    "How to Choose a Cloud Storage Plan",
    "Affordable Cloud Storage Pricing"
  ],
  "body": "Affordable cloud storage lets you scale..."
}

If you see that output, the endpoint is working correctly and the structured SEO content is ready to use.

Costs

Fikra API charges per 1 million tokens, with different rates by model. The available models and their input/output prices are:

Model Input (USD / 1M tokens) Output (USD / 1M tokens)
deepseek-v4-flash-0731 0.09 0.15
deepseek-v4.1-flash 0.25 0.80
deepseek-v4.1-flash-1017 0.30 0.85
fikra-auto 0.40 0.40
fikra-auto-pro 6.00 12.00
fikra-code-35b 1.00 1.00

For the exact current price list, check the pricing page.

Common errors

usagestatusdashboard