Skip to navigationSkip to main contentSkip to footerScaleway DocsAsk our AI
Ask our AI

Integrating OpenCode with Scaleway's Generative APIs

OpenCode is a coding agent for terminal and IDE. You can integrate Scaleway's Generative APIs models to OpenCode.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • A valid API key for API authentication
  • Installed OpenCode on your local machine

Configure OpenCode

  1. Start OpenCode:

    opencode
    Tip

    If command not found displays, ensure you have properly installed opencode and registered the tool in your terminal configuration. After installation, you can launch a new terminal or reload your current terminal configuration with:

    source ~/.bashrc # Or source ~/.zshrc if you use zsh
  2. Press Ctrl + P to display commands.

  3. Type provider to search for commands. Select Connect provider, then press Enter.

  4. Type scaleway to search for providers. Select Scaleway, then press Enter.

  5. Enter your SCW_SECRET_KEY as API key. Press Enter.

  6. Select a model in the list, for instance Devstral 2 123B Instruct (2512).

  7. Type any prompt asking opencode to create or update code files. For example:

    "Write a fibonnaci function in python that compute the first 10 fibonnaci numbers"

Going further

  • You can explore OpenCode additional features and configure OpenCode using a JSON configuration file.
  • By default, requests are performed to https://api.scaleway.ai/v1 on your Scaleway default project. If you want to perform requests on a specific project (for instance, to track specific billing), edit OpenCode JSON configuration with URL: https://api.scaleway.ai/###PROJECT_ID###/v1
Still need help?

Create a support ticket
No Results