Fikra API solutions · all how-tos

Add LLM Embeddings to a Knowledge Base on a Budget

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.045, 'output': 0.1, 'cached_input': 0.025}
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-21

models & pricing: deepseek-v4-flash-0731 (in 0.045 / out 0.1 USD per 1M tokens) deepseek-v4.1-flash (in 0.045 / out 0.09 USD per 1M tokens) deepseek-v4.1-flash-1017 (in 0.05 / out 0.11 USD per 1M tokens) fikra-auto (in 0.045 / out 0.35 USD per 1M tokens) fikra-auto-pro (in 6.0 / out 12.0 USD per 1M tokens) fikra-code-35b (in 0.045 / out 0.33 USD per 1M tokens)

These rates are served from the same registry that answers GET /v1/models; the how-to numbers above match /pricing exactly.

Overview

Add inexpensive vector embeddings to your knowledge base using the Fikra API. The service is OpenAI‑compatible, so you can use the standard openai Python SDK with a custom base URL. You pay per‑token in USD, and the cheapest model (deepseek-v4-flash-0731) costs $0.045 USD per 1M input tokens.

Prerequisites

Step-by-step

  1. Set up the SDK ```python import os, openai

openai.api_key = os.getenv("FIKRA_API_KEY") openai.base_url = "https://api.fikraapi.co.ke/v1" 2. **Prepare your texts**python texts = [ "What is the return policy?", "How do I reset my password?", "Pricing details for premium plans", ] 3. **Request embeddings**python response = openai.embeddings.create( model="deepseek-v4-flash-0731", input=texts, ) embeddings = [e.embedding for e in response.data] `` 4. **Store vectors** to insert eachembedding` into your vector store (e.g., Pinecone, Qdrant, or a simple SQLite + FAISS index). The exact storage code depends on your chosen backend, but the output format is a list of floats ready for indexing.

Verify it works

# Print the dimension of the first vector to confirm a successful call
print(len(embeddings[0]))

If you see a non‑zero length (typically 768‑1536 depending on the model), the embeddings are ready for use.

Costs

Common errors

usagestatusdashboard