freeaiapi.ai
Integrations

OpenCode

Add freeaiapi.ai as a custom provider in OpenCode.

  1. Run /connect, choose Other, enter the provider id freeaiapi and your API key.
  2. Add the provider to opencode.json in your project:
opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "freeaiapi": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "freeaiapi.ai",
      "options": { "baseURL": "https://api.freeaiapi.ai/v1" },
      "models": {
        "deepseek-chat": { "name": "DeepSeek Chat" },
        "gpt-4o-mini": { "name": "GPT-4o mini" }
      }
    }
  }
}

Add any model ID from the model list under models. To read the key from an environment variable instead of /connect, set "apiKey": "{env:FREEAIAPI_KEY}" inside options.