Skip to content

Opus 4.7 doesn't work through Google Vertex AI #27063

Closed

Description

@PowerSlime

Description

Opus 4.7 is available in model selection in OpenCode but when using it - it always return 429. To be clear: we have it enabled in our organization and it's available through Claude Code (but requires CLOUD_ML_REGION=eu to be set, which OpenCode seems to ignore).

Another problem that 1M token Sonnet/Opus aren't in the list, but should I create a separate issue for that?
https://docs.cloud.google.com/vertex-ai/generative-ai/docs/partner-models/claude/sonnet-4-6 and some other models has already "Maximum input tokens: 1,000,000", put in OpenCode it looks that it is still set to 200k

Plugins

No response

OpenCode version

1.14.48

Steps to reproduce

  1. Use https://opencode.ai/docs/providers/#google-vertex-ai for specific of installation
  2. In our case variables are next (we use just models available in EU):
GOOGLE_APPLICATION_CREDENTIALS=/home/<redacted>/.config/gcloud/application_default_credentials.json
GOOGLE_CLOUD_PROJECT=<redacted>
VERTEX_LOCATION=europe-west1 # note that nothing changes if I set "eu" there

# Claude Code
export CLOUD_ML_REGION=eu

export CLAUDE_CODE_USE_VERTEX=1
export ANTHROPIC_VERTEX_PROJECT_ID=<redacted>
  1. Open OpenCode, select Opus 4.6, everything works
  2. Select Opus 4.7 - 429 is returned
    If you select same model within Claude Code - everything is fine. So the problem is most probably on provider side.

Screenshot and/or share link

Opus 4.7
Image

Opus 4.6
Image

Operating System

Arch Linux

Terminal

Ghostty

Activity

  1. github-actions commented on May 12, 2026

    @github-actions
    Contributor

    This issue might be a duplicate (for the 1M token context window part) of existing issues. Please check:

    The Opus 4.7 returning 429 with CLOUD_ML_REGION being ignored appears to be a distinct new issue, so that part is fine to keep here. You may want to split the 1M token concern into a separate comment on #14003 or #12338 rather than tracking it here.

  2. PowerSlime commented on May 12, 2026

    @PowerSlime
    Author

    This issue might be a duplicate (for the 1M token context window part) of existing issues. Please check:

    The Opus 4.7 returning 429 with CLOUD_ML_REGION being ignored appears to be a distinct new issue, so that part is fine to keep here. You may want to split the 1M token concern into a separate comment on #14003 or #12338 rather than tracking it here.

    I don't think they are really duplicates, since mine one is related specifically to Google Vertex AI provider 🤔

  3. rti commented on May 21, 2026

    @rti

    I just got Opus 4.7 via Vertex to work from the "global" region in OpenCode 1.14.48.

    VERTEX_LOCATION=global
    {
      "$schema": "https://opencode.ai/config.json",
      "enabled_providers": [
        "google-vertex"
      ],
      "provider": {
        "google-vertex": {
          "whitelist": [
            "claude-opus-4-7@default"
          ]
        }
    }

    I think #28347 is the fix for the issue we are facing

  4. PowerSlime commented on May 21, 2026

    @PowerSlime
    Author

    I just got Opus 4.7 via Vertex to work from the "global" region in OpenCode 1.14.48.

    VERTEX_LOCATION=global
    {
    "$schema": "https://opencode.ai/config.json",
    "enabled_providers": [
    "google-vertex"
    ],
    "provider": {
    "google-vertex": {
    "whitelist": [
    "claude-opus-4-7@default"
    ]
    }
    }
    I think #28347 is the fix for the issue we are facing

    The only problem is that it's available in EU as well https://docs.cloud.google.com/vertex-ai/generative-ai/docs/partner-models/claude/opus-4-7.

    And at least in the company I'm working we have global region disabled due to policy/laws reasons. So... Even if global region has it - the problem that somehow EU ones doesn't get picked up as Claude Code pick it up.

    P.S. PR you mentioned - seems to be fixing it (haven't run it, just checked the diff). At least looks more or less about it. 👀

  5. rti commented on May 21, 2026

    @rti

    See my comment in the PR #28347 (comment) for a workaround

  6. miguelmanlyx commented on May 21, 2026

    @miguelmanlyx

    Might be rate-limit errors from Gemini. npx ai-doctor can help check missing Retry-After handling and unsafe retry logic.

  7. rekram1-node commented on May 22, 2026

    @rekram1-node
    Collaborator

    this should be fixed in next release, will look at the 1M context separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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