Api.Airforce
OPENCODE

OpenCode Integration

Use Airforce as an OpenAI-compatible provider inside OpenCode (sst/opencode) — any of the 100+ Airforce-hosted models become selectable in the TUI.

OpenCode wires providers through the Vercel AI SDK. Its @ai-sdk/openai-compatible adapter speaks any OpenAI-compatible endpoint, so pointing it at Airforce is a config edit — no patches, no forks.

Install

macOS / Linux / WSL

curl -fsSL https://opencode.ai/install | bash

npm (cross-platform)

npm install -g opencode-ai@latest

Airforce को प्रदाता के रूप में कॉन्फ़िगर करें

Create opencode.json in your project root (or ~/.config/opencode/opencode.json for a global default) and add Airforce under the provider key:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "airforce": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Airforce",
      "options": {
        "baseURL": "https://api.airforce/v1"
      },
      "models": {
        "claude-sonnet-4.5": { "name": "Claude Sonnet 4.5" },
        "gpt-5": { "name": "GPT-5" },
        "glm-4.6": { "name": "GLM 4.6" },
        "deepseek-v3.2": { "name": "DeepSeek V3.2" }
      }
    }
  },
  "model": "airforce/claude-sonnet-4.5"
}

मॉडल चुनना। Any id from Airforce's /v1/models works as a model key — only models with Tools ✓ on the models page will give you a working coding agent (read/edit/bash).

API कुंजी रजिस्टर करें

OpenCode keeps keys in the system keyring (not the config file). Register Airforce once with:

opencode auth login

Select airforce when prompted, then paste your Airforce API key (starts with sk-air-).

चलाएं

cd your-project
opencode

Type /models inside the TUI to switch between the models you listed.

Troubleshooting

मॉडल टेक्स्ट से जवाब देता है पर फ़ाइलें संपादित नहीं करता

The upstream provider for that model doesn't forward tools. Pick a model marked Tools ✓ on the models page.

ऑथ प्रॉम्प्ट लूप

Your key may be stored under a different provider name. Run opencode auth logout, then opencode auth login again and choose airforce.