opencode

Add Aerless AI as a provider in one file.

Follows the opencode docs.

  1. Get a key

    Create one in the dashboard and top up. The quick start shows how.

  2. Set the key

    bash
    export AERLESS_API_KEY="AERLESS_..."
  3. Copy the file

    opencode.jsonc
    {
      "providers": {
        "aerless-ai": {
          "name": "Aerless AI",
          "env": [
            "AERLESS_API_KEY"
          ],
          "package": "@opencode/ai/providers/openai-compatible",
          "settings": {
            "baseURL": "https://api.aerless.si/v1"
          },
          "models": {
            "deepseek-v4.1-flash-abliterated": {
              "name": "DeepSeek V4.1 Flash (abliterated)"
            },
            "deepseek-v4.1-flash-abliterated-fast": {
              "name": "DeepSeek V4.1 Flash Fast (abliterated)"
            },
            "deepseek-v4.1-flash-fast": {
              "name": "DeepSeek V4.1 Flash Fast"
            },
            "glm-5.3-abliterated": {
              "name": "GLM 5.3 (abliterated)"
            },
            "glm-5.3-flash-abliterated": {
              "name": "GLM 5.3 Flash (abliterated)"
            },
            "kimi-k3.1-pro-abliterated": {
              "name": "Kimi K3.1 Pro (abliterated)"
            }
          }
        }
      }
    }

    If your opencode version rejects it, its provider docs name the current keys.

  4. Check it works

    Start opencode, pick a model from the Aerless AI provider and ask something. A reply means you are connected. Or from a shell, with your key in AERLESS_API_KEY:

    request
    curl https://api.aerless.si/v1/chat/completions \
      -H "Authorization: Bearer $AERLESS_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "deepseek-v4.1-flash-abliterated",
        "messages": [{"role": "user", "content": "Write a two-line poem about the sea."}]
      }'
    example reply
    Grey tides fold the evening light,
    and carry every shore toward night.
    Not working?
    401 invalid_api_key
    Check the key and the header format (Authorization: Bearer <key>). Create a new key in the dashboard if needed.
    402 insufficient_balance
    Top up, or lower max_tokens so the hold is smaller.
    404 not_found
    Check the base URL ends in /v1 and the path is one of the documented endpoints.
    400 invalid_request
    Fix the request. The message says what is wrong and param names the field. Do not retry unchanged.