OpenCode

OpenCode talks to Astorias as a custom OpenAI-compatible provider. You give it an ast_ key, the Astorias base URL, and the catalog ids you want in the model picker. Create config writes the provider block for you from the live catalog.

Setup

  1. 1

    Generate your config

    Click Create config at the top, choose your models, and paste the result into ~/.config/opencode/opencode.json.
  2. 2

    Create an API key

    Organization admins create keys at APIs. Copy the ast_ key when it is shown.
  3. 3

    Store the key in OpenCode

    Run /connect, choose Other, type astorias as the provider id, and paste the key. OpenCode keeps it in its own auth file, so your config holds no secret.
  4. 4

    Pick the model

    Run /models and choose your model under Astorias.

Manual setup

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "astorias/{model-id}",
  "provider": {
    "astorias": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Astorias",
      "options": {
        "baseURL": "https://api.astorias.ai/v1"
      },
      "models": {
        "{model-id}": {
          "name": "{model-name}",
          "limit": {
            "context": {context-tokens},
            "output": {max-output-tokens}
          }
        }
      }
    }
  }
}

Replace the braced placeholders before saving. {model-id} is a catalog id from GET /v1/models or Model Garden, and it is the exact string OpenCode sends as model. {model-name} is only the label shown in the picker. {context-tokens} and {max-output-tokens} are plain numbers from the same catalog entry, so OpenCode can track how much context is left. Add one entry under models per catalog id you want to use.

OpenCode splits the selector on the first slash, so astorias/{model-id} means provider astorias and model {model-id}, even when the model id has its own slash.

OpenCode v2 config

V2 renames the fields. Use providers instead of provider, package set to @opencode/ai/providers/openai-compatible instead of npm, and settings.baseURL instead of options.baseURL. The base URL, key, and model ids stay the same.

Tool calls work on models that list tools in the catalog. Requests spend organization credits like any other key. See Usage and billing.