Fikra API solutions · all how-tos

Wire an AI Agent to Send WhatsApp Replies

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 who need production inference. To wire an AI agent to send WhatsApp replies, you call Fikra API’s chat completions endpoint from your backend, receive the reply text, then pass it to your WhatsApp sending integration.

Because the API is OpenAI-compatible, any existing OpenAI SDK client can be pointed at Fikra API’s base URL without changing your request or response format.

Prerequisites

Step-by-step

  1. Configure the OpenAI SDK client with the Fikra base URL.
  2. Create a function that takes an incoming WhatsApp message, calls the Fikra chat completions endpoint, and returns the generated reply.
  3. Send the returned reply through your WhatsApp integration.

Example:

import os
from openai import OpenAI

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

def generate_reply(incoming_text: str) -> str:
    response = client.chat.completions.create(
        model="deepseek-v4-flash-0731",
        messages=[
            {"role": "system", "content": "You are a WhatsApp assistant that replies concisely."},
            {"role": "user", "content": incoming_text},
        ],
    )
    return response.choices[0].message.content.strip()

# Pass the reply to your WhatsApp integration, e.g.:
# whatsapp_send(incoming_chat_id, generate_reply(incoming_text))

Streaming is supported, so you can use any OpenAI-style streaming parameter if your WhatsApp agent needs token-by-token output.

Verify it works

Run a quick test locally:

print(generate_reply("Hello, are you open today?"))

You should see a generated reply printed. Then connect the function to your WhatsApp integration and send a real message to confirm the full flow works.

Costs

The example uses deepseek-v4-flash-0731: $0.09 per 1M input tokens and $0.15 per 1M output tokens. Fikra API runs on a token-credit wallet; top up with M-Pesa or card via Paystack, or use x402 USDC on Base for agent usage. For a full list of models and rates, check the pricing page.

Common errors

usagestatusdashboard