Fikra API solutions · all how-tos

Run a WhatsApp AI Assistant 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

Run a cheap, production‑grade AI assistant on WhatsApp by routing user messages to Fikra API’s OpenAI‑compatible chat endpoint. The service works with any WhatsApp webhook provider and charges only for the tokens you use.

Prerequisites

Step-by-step

  1. Install the SDK bash pip install openai flask
  2. Set the API key bash export FIKRA_API_KEY=your_fikra_api_key
  3. Create a simple Flask webhook that receives a WhatsApp message, calls Fikra, and returns the reply. ```python import os, openai from flask import Flask, request, jsonify

openai.api_key = os.getenv("FIKRA_API_KEY") openai.base_url = "https://api.fikraapi.co.ke/v1"

app = Flask(name)

@app.route("/whatsapp-webhook", methods=["POST"]) def webhook(): data = request.json user_msg = data.get("message") if not user_msg: return jsonify({"error": "no message"}), 400

   response = openai.ChatCompletion.create(
       model="deepseek-v4-flash-0731",
       messages=[{"role": "user", "content": user_msg}],
       stream=False,
   )
   reply = response.choices[0].message.content
   # TODO: send `reply` back to WhatsApp via your provider's API
   return jsonify({"reply": reply})

if name == "main": app.run(port=5000) `` The SDK automatically adds the headerAuthorization: Bearer . 4. **Connect your WhatsApp provider** to POST incoming messages tohttps://yourdomain.com/whatsapp-webhook`. 5. Deploy the Flask app (Heroku, Render, Fly.io, etc.) and ensure it is reachable over HTTPS.

Verify it works

Costs

Common errors

usagestatusdashboard