Fikra API solutions · all how-tos

How to detect duplicate support tickets with embeddings

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 inference API. You send ticket text to the embeddings endpoint, get one vector per ticket, and compare vectors to surface near-duplicates before an agent picks them up. The same base URL and key also serve chat models, so you can extend the flow later.

Prerequisites

Step-by-step

  1. Export your key and create a client pointed at the Fikra base URL.
  2. Send the ticket texts to POST https://api.fikraapi.co.ke/v1/embeddings in one request.
  3. Compute cosine similarity between every pair of vectors.
  4. Flag pairs above a threshold you tune on your own data.
import os
from openai import OpenAI

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

tickets = [
    "I was charged twice for my subscription this month.",
    "Duplicate charge on my card for the monthly plan.",
    "How do I reset my password?",
]

response = client.embeddings.create(
    model="fikra-auto",
    input=tickets,
)

vectors = [item.embedding for item in response.data]

Model availability and per-model pricing are on the pricing page , confirm the model you pass before production use.

import math

def cosine(a, b):
    dot = sum(x * y for x, y in zip(a, b))
    na = math.sqrt(sum(x * x for x in a))
    nb = math.sqrt(sum(y * y for y in b))
    return dot / (na * nb)

THRESHOLD = 0.90  # starting point only; tune against your own tickets

for i in range(len(vectors)):
    for j in range(i + 1, len(vectors)):
        score = cosine(vectors[i], vectors[j])
        if score >= THRESHOLD:
            print(f"possible duplicate: {i} <-> {j} score={score:.3f}")

Requests and responses follow the OpenAI-style shape, so existing OpenAI SDK code works once you change base_url and the key.

Verify it works

Costs

Usage is billed per token against your token-credit wallet, in USD or KES. Pricing starts at $0.09 per 1M input tokens and $0.15 per 1M output tokens. Listed examples:

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

Top up by M-Pesa or card through Paystack, or with x402 USDC on Base for agents. Rate limits are 30 requests/min for unverified accounts and 100 requests/min for trusted accounts. For anything not listed here, check the pricing page.

Common errors

Last updated 2026-10-18.

usagestatusdashboard