By Fikra DevRel • 4 min read

Use Fikra API with OpenCode: OpenAI-compatible setup

Use Fikra API with OpenCode: OpenAI-compatible setup

OpenCode accepts custom OpenAI-compatible providers in opencode.json, so the setup is one base URL, one API key and one model ID. This page is the Fikra side of that setup. Check OpenCode's current provider documentation before you change a config file.

Config

Set the key in your shell:

export FIKRA_API_KEY="your-fikra-api-key"

Add the provider to opencode.json in your project root:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "fikra": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Fikra API",
      "options": {
        "baseURL": "https://api.fikraapi.co.ke/v1",
        "apiKey": "{env:FIKRA_API_KEY}"
      },
      "models": {
        "deepseek-v4.1-flash-1017": {
          "name": "DeepSeek V4.1 Flash 1017",
          "limit": { "context": 1048576, "output": 393216 }
        }
      }
    }
  },
  "model": "fikra/deepseek-v4.1-flash-1017"
}

If your OpenCode version already lists Fikra in the built-in provider catalog, export the key and pick the model from the session model list without editing config.

The lane for agent work

deepseek-v4.1-flash-1017 is the lane long sessions run on: 1,048,576 context and 393,216 max output, priced at $0.045 per 1M input tokens and $0.09 per 1M output tokens. GLM and Kimi lanes are served from the same endpoint when a session needs them.

Confirm console limits in GET /v1/models before you pin a specific build in config.

Top up, then run

  1. Create a developer account.
  2. Add credits from $1 with M-Pesa or a card, then mint a key.
  3. Top-up accounts run at 3,000 requests per minute and up to 1 billion tokens per day, so long agent sessions do not trip 429s. Confirm the current numbers in the limits docs before planning.

If something in this page does not match what you see, write to [email protected] and it gets fixed.


JM
// The Founder

James Miano

CTO & ML Engineer at Lacesse Ventures. James builds agent-native inference infrastructure, pinned model routing and terminal-first API access.

Stop paying for overpriced round-trip latency

Why settle for slow routes and opaque pricing? Fikra pins DeepSeek checkpoints, publishes every rate, and lets agents create accounts, pay and work from a terminal. No minimum credit limits. Pay with card or mobile money.

usagestatusdashboard