Skip to content

[FEATURE]: Add support for Anthropic models in Azure AI Foundry #4474

Closed

Description

@CarlosGtrz

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Anthropic models are now available in Azure AI Foundry. Reference: https://code.claude.com/docs/en/azure-ai-foundry

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Nov 19, 2025
  2. rekram1-node commented on Nov 19, 2025

    @rekram1-node
    Collaborator

    Yep we should do that, basically just means updating: https://github.com/sst/models.dev

  3. cau1k commented on Nov 20, 2025

    @cau1k

    Looking into this now - added support in anomalyco/models.dev#405 but unable to use the claude models yet. Wondering if we should wait for ai-sdk/azure support for @anthropic-ai/foundry-sdk or just add a switch for the time being.

  4. rekram1-node commented on Nov 20, 2025

    @rekram1-node
    Collaborator

    u can override the npm package per model if u need to:

    [provider]
    npm = “…”

  5. cau1k commented on Nov 20, 2025

    @cau1k

    u can override the npm package per model if u need to:

    [provider] npm = “…”

    Thanks - fixed in anomalyco/models.dev#409

  6. krishna1s commented on Nov 20, 2025

    @krishna1s

    is this available with latest opencode version 1.0.80

  7. rekram1-node commented on Nov 20, 2025

    @rekram1-node
    Collaborator

    @krishna1s should be you just need to restart opencode a couple of times to refresh ur cache

  8. krishna1s commented on Nov 20, 2025

    @krishna1s

    @rekram1-node I can see now azure/claude-sonnet-4-5, is there any way to clean the cache. Also would opencode auth login with azure, going to support foundry key or we need to set env as suggested here

  9. rekram1-node commented on Nov 20, 2025

    @rekram1-node
    Collaborator

    is there any way to clean the cache

    rm ~/.cache/opencode/models.json

    Uh idk I didn't set it up but i can take a look when I get a chance

  10. krishna1s commented on Nov 20, 2025

    @krishna1s

    I tried configuring anthropic env variable but it doesn't seems to be working

  11. cau1k commented on Nov 21, 2025

    @cau1k

    @krishna1s this works, just set the envs to your foundry creds (base url: https://{resource-name}.services.ai.azure.com/anthropic/v1)

    {
      "provider": {
        "azure": {
          "models": {
            "claude-haiku-4-5": {
              "id": "claude-haiku-4-5",
              "provider": {
                "npm": "@ai-sdk/anthropic",
                "options": {
                  "apiKey": "{env:ANTHROPIC_FOUNDRY_API_KEY}",
                  "baseURL": "{env:ANTHROPIC_FOUNDRY_BASE_URL}"
                }
              }
            }
          }
        }
      }
    }
    
  12. edisonpaul4 commented on Nov 21, 2025

    @edisonpaul4

    This is very important :)

  13. edisonpaul4 commented on Nov 21, 2025

    @edisonpaul4

    @krishna1s this works, just set the envs to your foundry creds (base url: https://{resource-name}.services.ai.azure.com/anthropic/v1)

    {
    "provider": {
    "azure": {
    "models": {
    "claude-haiku-4-5": {
    "id": "claude-haiku-4-5",
    "provider": {
    "npm": "@ai-sdk/anthropic",
    "options": {
    "apiKey": "{env:ANTHROPIC_FOUNDRY_API_KEY}",
    "baseURL": "{env:ANTHROPIC_FOUNDRY_BASE_URL}"
    }
    }
    }
    }
    }
    }
    }

    Didnt work for me.

    Image

    `
    INFO 2025-11-21T14:49:36 +0ms service=session.prompt sessionID=ses_5591ba16affeJMoRrZpI0kg4cr cancel
    INFO 2025-11-21T14:49:36 +1ms service=bus type=session.status publishing
    INFO 2025-11-21T14:49:36 +0ms service=bus type=session.idle publishing
    68 | autoload: false,
    69 | async getModel(sdk: any, modelID: string, options?: Record<string, any>) {
    70 | if (options?.["useCompletionUrls"]) {
    71 | return sdk.chat(modelID)
    72 | } else {
    73 | return sdk.responses(modelID)
    ^
    TypeError: sdk.responses is not a function. (In 'sdk.responses(modelID)', 'sdk.responses' is undefined)
    at (src/provider/provider.ts:73:24)
    at getModel (src/provider/provider.ts:69:34)
    at getModel (src/provider/provider.ts:584:26)

    INFO 2025-11-21T14:49:36 +0ms service=provider status=completed duration=43 providerID=azure getSDK
    ERROR 2025-11-21T14:49:36 +1ms service=acp-command promise={} reason=sdk.responses is not a function. (In 'sdk.responses(modelID)', 'sdk.responses' is undefined) Unhandled rejection
    ERROR 2025-11-21T14:49:36 +0ms service=default e=sdk.responses is not a function. (In 'sdk.responses(modelID)', 'sdk.responses' is undefined) rejection
    INFO 2025-11-21T14:49:36 +3ms service=default directory=/home/edisonpaul4 disposing instance
    INFO 2025-11-21T14:49:36 +0ms service=state key=/home/edisonpaul4 waiting for state disposal to complete
    INFO 2025-11-21T14:49:36 +1ms service=state key=/home/edisonpaul4 state disposal completed
    `

  14. 4 remaining items

  15. krishna1s commented on Nov 25, 2025

    @krishna1s

    Does it work irrespective of foundry deployment name ?

  16. niusnet commented on Nov 25, 2025

    @niusnet

    Yes, it works regardless of the Foundry deployment name.

    The resource URL is configured through an environment variable like ANTHROPIC_FOUNDRY_BASE_URL, where you set the full URL of your resource:

    https://[RESOURCE_NAME].services.ai.azure.com/anthropic/v1

    So the deployment name itself doesn't matter what matters is that the base URL points to your specific Azure AI Foundry resource.

  17. rekram1-node commented on Nov 25, 2025

    @rekram1-node
    Collaborator

    do we need to update models.dev was it incorrect?

  18. cloonix commented on Nov 27, 2025

    @cloonix

    The resource name can also be provided in opencode.json. The API-Key can be set in auth.json as well. That's my current setup. Thanks to the comment before.

      "provider": {
        "azure-anthropic": {
          "name": "Azure AI Foundry (Anthropic)",
          "npm": "@ai-sdk/anthropic",
          "api": "https://<RSN>.ai.azure.com/anthropic/v1",
          "models": {
            "claude-opus-4-5": {
              "id": "claude-opus-4-5",
              "name": "Claude Opus 4.5",
              "tool_call": true,
              "attachment": true,
              "reasoning": true,
              "temperature": true
            },
            "claude-sonnet-4-5": {
              "id": "claude-sonnet-4-5",
              "name": "Claude Sonnet 4.5",
              "tool_call": true,
              "attachment": true,
              "reasoning": true,
              "temperature": true
            }
          }

    auth.json:

    {
      "azure-anthropic": {
        "type": "api",
        "key": "xyz"
      }
    }
  19. lasficw commented on Jan 5, 2026

    @lasficw

    The resource name can also be provided in opencode.json. The API-Key can be set in auth.json as well. That's my current setup. Thanks to the comment before.

    "provider": {
    "azure-anthropic": {
    "name": "Azure AI Foundry (Anthropic)",
    "npm": "@ai-sdk/anthropic",
    "api": "https://.ai.azure.com/anthropic/v1",
    "models": {
    "claude-opus-4-5": {
    "id": "claude-opus-4-5",
    "name": "Claude Opus 4.5",
    "tool_call": true,
    "attachment": true,
    "reasoning": true,
    "temperature": true
    },
    "claude-sonnet-4-5": {
    "id": "claude-sonnet-4-5",
    "name": "Claude Sonnet 4.5",
    "tool_call": true,
    "attachment": true,
    "reasoning": true,
    "temperature": true
    }
    }

    auth.json:

    {
    "azure-anthropic": {
    "type": "api",
    "key": "xyz"
    }
    }

    This works great in the Terminal but not on the Web UI for some reason. Has anybody found a workaround for that?

  20. bluet commented on Jan 13, 2026

    @bluet
    Contributor

    I'm having the issue with OpenCode 1.1.16 , is that opencode need to dump version of dependency, or this need to be configured manually?

  21. jonas-lomholdt commented on Jan 30, 2026

    @jonas-lomholdt

    The resource name can also be provided in opencode.json. The API-Key can be set in auth.json as well. That's my current setup. Thanks to the comment before.

    "provider": {
    "azure-anthropic": {
    "name": "Azure AI Foundry (Anthropic)",
    "npm": "@ai-sdk/anthropic",
    "api": "https://.ai.azure.com/anthropic/v1",
    "models": {
    "claude-opus-4-5": {
    "id": "claude-opus-4-5",
    "name": "Claude Opus 4.5",
    "tool_call": true,
    "attachment": true,
    "reasoning": true,
    "temperature": true
    },
    "claude-sonnet-4-5": {
    "id": "claude-sonnet-4-5",
    "name": "Claude Sonnet 4.5",
    "tool_call": true,
    "attachment": true,
    "reasoning": true,
    "temperature": true
    }
    }
    auth.json:

    {
    "azure-anthropic": {
    "type": "api",
    "key": "xyz"
    }
    }

    This worked for me on 1.1.45! You don't have to add the api key in auth.json, it will ask the first time inside OpenCode and if you paste it there, it will add it for you. If you do want to add it manually it's in ~/.local/share/opencode/auth.json

  22. FaresKi commented on Feb 2, 2026

    @FaresKi

    Just fyi, still having the same issue under the latest version. Bypassing for now with custom provider but not all features are working great (variants for example or pricing)

  23. hathagat commented on Mar 6, 2026

    @hathagat

    The resource name can also be provided in opencode.json. The API-Key can be set in auth.json as well. That's my current setup. Thanks to the comment before.
    "provider": {
    "azure-anthropic": {
    "name": "Azure AI Foundry (Anthropic)",
    "npm": "@ai-sdk/anthropic",
    "api": "https://.ai.azure.com/anthropic/v1",
    "models": {
    "claude-opus-4-5": {
    "id": "claude-opus-4-5",
    "name": "Claude Opus 4.5",
    "tool_call": true,
    "attachment": true,
    "reasoning": true,
    "temperature": true
    },
    "claude-sonnet-4-5": {
    "id": "claude-sonnet-4-5",
    "name": "Claude Sonnet 4.5",
    "tool_call": true,
    "attachment": true,
    "reasoning": true,
    "temperature": true
    }
    }
    auth.json:
    {
    "azure-anthropic": {
    "type": "api",
    "key": "xyz"
    }
    }

    This worked for me on 1.1.45! You don't have to add the api key in auth.json, it will ask the first time inside OpenCode and if you paste it there, it will add it for you. If you do want to add it manually it's in ~/.local/share/opencode/auth.json

    For me it is working on 1.2.17 as well. But I needed to change the API URL to https://<RSN>.services.ai.azure.com/anthropic/v1.
    Without "services", no connection could be established.

  24. rekram1-node commented on Apr 30, 2026

    @rekram1-node
    Collaborator

    If you use the azure provider in opencode this should just work, all models should behave as expected.

    I'm realizing we mistakenly added a duplicate provider to models.dev called azure-cognitive-services if you are using that one it may not behave correctly so make sure you are authed for azure

  25. lazka commented on May 4, 2026

    @lazka

    Using the default azure provider with v1.14.32 results in:

    _.responses is not a function. (In '_.responses($)', '_.responses' is undefined)
    

    when using Claude models. The custom config is still required.

    I think this should be re-opened.

  26. rekram1-node commented on May 4, 2026

    @rekram1-node
    Collaborator

    Oh thanks for raising thatll be resolved in next release

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionUsed for feature requests, proposals, ideas, etc. Open discussiongood first issueGood for newcomershelp-wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions