OpenCode

Let OpenCode send images to asAi.

OpenCode needs its own model metadata before it sends an image. The generator creates an @ai-sdk/openai-compatible provider section for https://serveras.click/v1, with attachment and modalities set from the live catalog.

Connect your key first

  1. Run /connect in OpenCode.
  2. Choose Other.
  3. Enter provider ID asai, then paste your asai_sk_... API key.

Never paste a real key into opencode.json. Keep it in OpenCode's credential flow. Create or manage a key under API keys.

Generate your model config

OpenCode config generator

The live catalog is loaded from GET /v1/models. Choose one model, every image-capable model, or the full catalog.

Loading the asAi model catalog...

Generated provider.asai config

For an existing setup, merge the provider.asai entry into your opencode.json. Do not replace other settings.

Choose a model set and select Generate config.

Why image input needs this config

For every image-capable model, the generator sets attachment: true and modalities.input to ["text", "image"]. It sets image input to false for text-only models. It also preserves the exact branded asAi model ID, context limit, and customer output cap.

By default, select asai/gpt-6-sol under One model. Use All image models when you want every current vision option. Use Full catalog only when you want text-only and vision models in the same OpenCode provider.

Verify it works

  1. Save your merged config and start a fresh OpenCode session.
  2. Select an asai/... image model and attach a small image.
  3. Ask a question that depends on visible pixels, such as a word printed in the image.
  4. Check Logs if you need to confirm a request reached asAi.

Troubleshooting

  • If OpenCode says a model cannot read images and no request appears in Logs, regenerate the config and make sure the selected model has image input.
  • Do not copy image capability settings to a text-only model. Check the live Models catalog first.
  • Start with a small image. Base64 image data increases request size.