Skip to content

Add support for Claude Sonnet/Opus 4 in Vertex AI #290

@admSla99

Description

@admSla99

OpenCode currently supports Claude 3/4 models through various providers, but it's missing support for the latest Claude 4 models (Claude Sonnet 4 and Claude Opus 4) that are now available through Google Vertex AI.

Requested Feature

Please add support for the following new Claude 4 models available through Vertex AI:

Claude Sonnet 4 (claude-sonnet-4)
Claude Opus 4 (claude-opus-4)

Why This Matters

  1. Latest AI Capabilities: Claude 4 models offer significant improvements in reasoning, coding assistance, and overall performance
  2. Google Vertex AI Integration: These models are officially supported by Google Cloud's Vertex AI platform
  3. Enterprise Use Cases: Many organizations use Vertex AI for their AI infrastructure and would benefit from accessing the latest Claude models through OpenCode
  4. Competitive Advantage: Supporting the latest models keeps OpenCode current with the rapidly evolving AI landscape

Technical Details

Since OpenCode already supports Vertex AI through:

VERTEXAI_PROJECT environment variable
VERTEXAI_LOCATION environment variable

The implementation should be straightforward by adding the new model identifiers to the existing Vertex AI provider configuration.
Expected Configuration
Users should be able to configure Claude 4 models like this:
{
"agents": {
"coder": {
"model": "claude-sonnet-4",
"maxTokens": 8000
},
"task": {
"model": "claude-opus-4",
"maxTokens": 8000
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions