Fikra API solutions · all how-tos

Generate images with Fikra API

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 is an OpenAI-compatible AI inference API for developers and growing AI teams. It exposes chat completions and embeddings endpoints behind a single OpenAI-style base URL. Fikra API does not list a dedicated image generation endpoint. To generate images, use a chat model to return image source code such as SVG, or to produce a detailed prompt that you can pass to an image rendering service.

Prerequisites

Step-by-step

  1. Install the OpenAI SDK:
pip install openai
  1. Create a chat completion that asks the model to generate an SVG image.
import os
from openai import OpenAI

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

response = client.chat.completions.create(
    model="deepseek-v4-flash-0731",
    messages=[
        {"role": "user", "content": "Generate an SVG image of a sunset over Nairobi skyline."}
    ],
)

svg = response.choices[0].message.content
print(svg)
  1. Save the returned SVG string to a file and open it in a browser or image viewer.

Verify it works

Check that response.choices[0].message.content contains valid SVG markup, usually starting with <svg. The response follows the OpenAI chat-completions format, so standard OpenAI SDK handling applies.

Costs

Fikra API charges per 1M tokens for chat models. For example, deepseek-v4-flash-0731 costs 0.09 USD per 1M input tokens and 0.15 USD per 1M output tokens. Other models have different rates; see the pricing page for the full list.

Common errors

usagestatusdashboard