Use OpenCode with Yolo-Auto's LLM API.

Add Yolo-Auto as an OpenAI-compatible provider in OpenCode, keep the API key in an environment variable, and run Qwen with free or flat-rate access.

Get a free OpenCode API key → Open full agent docs

Copyable config

Add one OpenAI-compatible provider block to opencode.json.

Environment-based key

Keep the Yolo-Auto API key out of the committed config file.

Free to test

Validate the provider before choosing a flat-rate paid plan.

Quick setup

Create an account, copy your yolo_... API key, set your base URL to https://yolo-auto.com/v1, and select qwen3.8-flash for Free or paid access. See the models page for details.

Best next pages

Docs · Pricing · Qwen Flash API · Free LLM API · Flat-rate LLM API

Connect OpenCode to Yolo-Auto

Create a Yolo-Auto key, export it as YOLO_AUTO_API_KEY, and add the provider configuration below to opencode.json. Select the Yolo-Auto Qwen model in OpenCode after the provider loads.

Why use a custom OpenCode provider

OpenCode can use OpenAI-compatible providers, so you can keep the coding-agent workflow while changing the model endpoint and pricing model.

OpenCode YOLO mode is a different feature

OpenCode permission modes sometimes use the word YOLO. That behavior is unrelated to Yolo-Auto. This guide configures Yolo-Auto as the model provider.

Who OpenCode LLM API Setup is actually for

OpenCode LLM API Setup is best for developers and power users who want model access inside tools, agents, scripts, and apps, not just a closed consumer chatbot tab.

Keep OpenCode, change the model provider

OpenCode supports custom providers through an OpenAI-compatible adapter. Yolo-Auto supplies the endpoint, API key, and public Qwen model while OpenCode keeps handling the coding-agent workflow.

The integration starts on the free tier. If longer coding sessions make token volume difficult to predict, the same provider config works with a flat-rate paid plan.

Add Yolo-Auto to opencode.json

Set the API key in your environment, then add the provider block below. The config uses OpenCode's OpenAI-compatible provider package and the free-compatible Yolo-Auto model.

These examples use qwen3.8-flash, our recommended model for text, images, and tools on Free and paid plans. Paid users can optionally choose yolo, a configurable route initially backed by Flash. Its server-side target can change while your client model ID stays the same.

1. Set the API key

export YOLO_AUTO_API_KEY="yolo_YOUR_KEY"

2. Add the provider

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "yolo-auto": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Yolo-Auto",
      "options": {
        "baseURL": "https://yolo-auto.com/v1",
        "apiKey": "{env:YOLO_AUTO_API_KEY}"
      },
      "models": {
        "qwen3.8-flash": {
          "name": "qwen3.8-flash",
          "limit": {
            "context": 131072,
            "output": 32768
          },
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          }
        }
      }
    }
  }
}

Do not commit the API key. OpenCode reads it from YOLO_AUTO_API_KEY.

When to choose Yolo-Auto

Choose it when

You need OpenAI-compatible LLM access, predictable cost, free testing, and no prompt retention. Your prompts and responses are not used for model training.

Skip it when

You need image generation, every model under the sun, a managed IDE, or a consumer-only chatbot with no API workflow.

Next step

Read the docs, check models, compare pricing, or review the privacy policy.

OpenCode LLM API Setup FAQ

Does OpenCode support Yolo-Auto?

Yes. Configure Yolo-Auto through OpenCode's OpenAI-compatible provider package and use the Yolo-Auto base URL and model ID.

Where should the API key go?

Set YOLO_AUTO_API_KEY in your environment and reference it from opencode.json instead of committing the secret.

Is this the same as enabling YOLO mode in OpenCode?

No. OpenCode permission behavior and Yolo-Auto's LLM API are separate features.

Related LLM API guides