Fikra API solutions · all how-tos

Embed Documents for Retrieval Augmented Generation

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 that lets you run chat and embedding models behind one OpenAI-style endpoint. For retrieval augmented generation (RAG), you can send documents to the embeddings endpoint and get vector embeddings back in OpenAI format. Because the API is OpenAI-compatible, it works with anything that accepts an OpenAI-compatible base URL.

Prerequisites

Step-by-step

  1. Install the OpenAI SDK

bash pip install openai

  1. Create the client

The base URL is https://api.fikraapi.co.ke/v1.

```python from openai import OpenAI

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

  1. Embed your documents

Choose a model from the Fikra API model list. For example, you can use fikra-auto.

```python documents = [ "Fikra API supports OpenAI-style chat completions.", "Embeddings are returned in OpenAI format.", ]

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

for i, data in enumerate(response.data): print(i, len(data.embedding)) ```

  1. Store and use the vectors

Store the returned embedding vectors in your vector database, then use them for retrieval in your RAG pipeline.

Verify it works

A successful call returns an OpenAI-style embeddings object with a data list. Each item in that list contains an embedding array and an index matching the order of your input documents. If you see one embedding per input document, the request worked.

Costs

Fikra API uses a token-credit wallet. You can top up with M-Pesa, cards via Paystack, or x402 USDC on Base for agents. Model pricing ranges from $0.09 to $6.00 per 1M input tokens and $0.15 to $12.00 per 1M output tokens depending on the model you choose. For exact embedding pricing and the full model list, check the pricing page.

Common errors

usagestatusdashboard