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

Open
opened 2026-02-16 17:38:00 -05:00 by yindo · 24 comments
Owner

Originally created by @CarlosGtrz on GitHub (Nov 18, 2025).

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

Originally created by @CarlosGtrz on GitHub (Nov 18, 2025). ### Feature hasn't been suggested before. - [x] 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
yindo added the help-wanteddiscussiongood first issue labels 2026-02-16 17:38:00 -05:00
Author
Owner

@rekram1-node commented on GitHub (Nov 19, 2025):

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

@rekram1-node commented on GitHub (Nov 19, 2025): Yep we should do that, basically just means updating: https://github.com/sst/models.dev
Author
Owner

@cau1k commented on GitHub (Nov 19, 2025):

Looking into this now - added support in sst/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.

@cau1k commented on GitHub (Nov 19, 2025): Looking into this now - added support in sst/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.
Author
Owner

@rekram1-node commented on GitHub (Nov 19, 2025):

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

[provider]
npm = “…”

@rekram1-node commented on GitHub (Nov 19, 2025): u can override the npm package per model if u need to: [provider] npm = “…”
Author
Owner

@cau1k commented on GitHub (Nov 19, 2025):

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

[provider] npm = “…”

Thanks - fixed in sst/models.dev#409

@cau1k commented on GitHub (Nov 19, 2025): > u can override the npm package per model if u need to: > > [provider] npm = “…” Thanks - fixed in sst/models.dev#409
Author
Owner

@krishna1s commented on GitHub (Nov 20, 2025):

is this available with latest opencode version 1.0.80

@krishna1s commented on GitHub (Nov 20, 2025): is this available with latest opencode version 1.0.80
Author
Owner

@rekram1-node commented on GitHub (Nov 20, 2025):

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

@rekram1-node commented on GitHub (Nov 20, 2025): @krishna1s should be you just need to restart opencode a couple of times to refresh ur cache
Author
Owner

@krishna1s commented on GitHub (Nov 20, 2025):

@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

@krishna1s commented on GitHub (Nov 20, 2025): @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](https://code.claude.com/docs/en/azure-ai-foundry)
Author
Owner

@rekram1-node commented on GitHub (Nov 20, 2025):

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

@rekram1-node commented on GitHub (Nov 20, 2025): > 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
Author
Owner

@krishna1s commented on GitHub (Nov 20, 2025):

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

@krishna1s commented on GitHub (Nov 20, 2025): I tried configuring anthropic env variable but it doesn't seems to be working
Author
Owner

@cau1k commented on GitHub (Nov 20, 2025):

@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}"
            }
          }
        }
      }
    }
  }
}

@cau1k commented on GitHub (Nov 20, 2025): @krishna1s this works, just set the envs to your foundry creds (base url: https://{resource-name}.services.ai.azure.com/anthropic/v1) ```jsonc { "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}" } } } } } } } ```
Author
Owner

@edisonpaul4 commented on GitHub (Nov 21, 2025):

This is very important :)

@edisonpaul4 commented on GitHub (Nov 21, 2025): This is very important :)
Author
Owner

@edisonpaul4 commented on GitHub (Nov 21, 2025):

@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
`

@edisonpaul4 commented on GitHub (Nov 21, 2025): > [@krishna1s](https://github.com/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. <img width="732" height="424" alt="Image" src="https://github.com/user-attachments/assets/74f55267-081d-46c1-b95e-2c34c8c0f21e" /> ` 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 <anonymous> (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 `
Author
Owner

@cau1k commented on GitHub (Nov 21, 2025):

@edisonpaul4 try using the anthropic provider with the same env. Had the same issue on my system but it works fine in a fresh environment https://github.com/cau1k/anthropic-foundry-opencode

@cau1k commented on GitHub (Nov 21, 2025): @edisonpaul4 try using the anthropic provider with the same env. Had the same issue on my system but it works fine in a fresh environment https://github.com/cau1k/anthropic-foundry-opencode
Author
Owner

@edisonpaul4 commented on GitHub (Nov 24, 2025):

@edisonpaul4 try using the anthropic provider with the same env. Had the same issue on my system but it works fine in a fresh environment https://github.com/cau1k/anthropic-foundry-opencode

Not working

INFO 2025-11-24T12:38:57 +0ms service=provider providerID=azure-custom pkg=@ai-sdk/anthropic using preinstalled provider
INFO 2025-11-24T12:38:57 +43ms service=provider status=completed duration=43 providerID=azure-custom getSDK
INFO 2025-11-24T12:38:57 +0ms service=provider status=completed duration=43 providerID=azure-custom getSDK
INFO 2025-11-24T12:38:57 +0ms service=provider providerID=azure-custom modelID=claude-haiku-4-5 found
INFO 2025-11-24T12:38:57 +0ms service=provider providerID=azure-custom modelID=claude-haiku-4-5 found
INFO 2025-11-24T12:38:57 +7ms service=bus type=message.updated publishing
ERROR 2025-11-24T12:38:57 +3ms service=session.prompt error=Anthropic API key is missing. Pass it using the 'apiKey' parameter or the ANTHROPIC_API_KEY environment variable. model=claude-haiku-4-5 failed to generate title
INFO 2025-11-24T12:38:57 +6ms service=bash-tool shell=/bin/bash bash tool using shell
INFO 2025-11-24T12:38:57 +5ms service=session.processor process
INFO 2025-11-24T12:38:57 +3ms service=bus type=session.status publishing
ERROR 2025-11-24T12:38:57 +1ms service=session.prompt error={"error":{"name":"AI_LoadAPIKeyError"}} stream error
ERROR 2025-11-24T12:38:57 +2ms service=session.processor error=Anthropic API key is missing. Pass it using the 'apiKey' parameter or the ANTHROPIC_API_KEY environment variable. process
INFO 2025-11-24T12:38:57 +0ms service=bus type=session.error publishing
INFO 2025-11-24T12:38:57 +1ms service=bus type=message.updated publishing
INFO 2025-11-24T12:38:57 +0ms service=session.compaction pruning
Error: Anthropic API key is missing. Pass it using the 'apiKey' parameter or the ANTHROPIC_API_KEY environment variable.
INFO 2025-11-24T12:38:57 +4ms service=session.prompt sessionID=ses_54a20280cffeTuZLqvjlf6Crcw cancel
INFO 2025-11-24T12:38:57 +0ms service=bus type=session.status publishing
INFO 2025-11-24T12:38:57 +0ms service=bus type=session.idle publishing
INFO 2025-11-24T12:38:57 +2ms service=bus type=message.updated publishing
ERROR 2025-11-24T12:38:57 +1ms service=acp-command promise={} reason=Anthropic API key is missing. Pass it using the 'apiKey' parameter or the ANTHROPIC_API_KEY environment variable. Unhandled rejection
ERROR 2025-11-24T12:38:57 +0ms service=default e=Anthropic API key is missing. Pass it using the 'apiKey' parameter or the ANTHROPIC_API_KEY environment variable. rejection
INFO 2025-11-24T12:38:57 +0ms service=bus type=session.updated publishing
INFO 2025-11-24T12:38:57 +0ms service=bus type=session.diff publishing
INFO 2025-11-24T12:38:57 +0ms service=session.compaction pruned=0 total=0 found

and this is my opencode.json (took your and just kept what i needed)

{
"$schema": "https://opencode.ai/config.json",
"provider": {
"azure-custom": {
"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}"
}
},
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 16000,
}
},
},
"claude-sonnet-4-5": {
"id": "claude-sonnet-4-5",
"provider": {
"npm": "@ai-sdk/anthropic",
"options": {
"apiKey": "{env:ANTHROPIC_FOUNDRY_API_KEY}",
"baseURL": "{env:ANTHROPIC_FOUNDRY_BASE_URL}"
}
},
"options": {
"thinking": {
"type": "enabled",
"budgetTokens": 16000,
}
},
},
}
},
}
}

@edisonpaul4 commented on GitHub (Nov 24, 2025): > [@edisonpaul4](https://github.com/edisonpaul4) try using the anthropic provider with the same env. Had the same issue on my system but it works fine in a fresh environment https://github.com/cau1k/anthropic-foundry-opencode Not working INFO 2025-11-24T12:38:57 +0ms service=provider providerID=azure-custom pkg=@ai-sdk/anthropic using preinstalled provider INFO 2025-11-24T12:38:57 +43ms service=provider status=completed duration=43 providerID=azure-custom getSDK INFO 2025-11-24T12:38:57 +0ms service=provider status=completed duration=43 providerID=azure-custom getSDK INFO 2025-11-24T12:38:57 +0ms service=provider providerID=azure-custom modelID=claude-haiku-4-5 found INFO 2025-11-24T12:38:57 +0ms service=provider providerID=azure-custom modelID=claude-haiku-4-5 found INFO 2025-11-24T12:38:57 +7ms service=bus type=message.updated publishing ERROR 2025-11-24T12:38:57 +3ms service=session.prompt error=Anthropic API key is missing. Pass it using the 'apiKey' parameter or the ANTHROPIC_API_KEY environment variable. model=claude-haiku-4-5 failed to generate title INFO 2025-11-24T12:38:57 +6ms service=bash-tool shell=/bin/bash bash tool using shell INFO 2025-11-24T12:38:57 +5ms service=session.processor process INFO 2025-11-24T12:38:57 +3ms service=bus type=session.status publishing ERROR 2025-11-24T12:38:57 +1ms service=session.prompt error={"error":{"name":"AI_LoadAPIKeyError"}} stream error ERROR 2025-11-24T12:38:57 +2ms service=session.processor error=Anthropic API key is missing. Pass it using the 'apiKey' parameter or the ANTHROPIC_API_KEY environment variable. process INFO 2025-11-24T12:38:57 +0ms service=bus type=session.error publishing INFO 2025-11-24T12:38:57 +1ms service=bus type=message.updated publishing INFO 2025-11-24T12:38:57 +0ms service=session.compaction pruning Error: Anthropic API key is missing. Pass it using the 'apiKey' parameter or the ANTHROPIC_API_KEY environment variable. INFO 2025-11-24T12:38:57 +4ms service=session.prompt sessionID=ses_54a20280cffeTuZLqvjlf6Crcw cancel INFO 2025-11-24T12:38:57 +0ms service=bus type=session.status publishing INFO 2025-11-24T12:38:57 +0ms service=bus type=session.idle publishing INFO 2025-11-24T12:38:57 +2ms service=bus type=message.updated publishing ERROR 2025-11-24T12:38:57 +1ms service=acp-command promise={} reason=Anthropic API key is missing. Pass it using the 'apiKey' parameter or the ANTHROPIC_API_KEY environment variable. Unhandled rejection ERROR 2025-11-24T12:38:57 +0ms service=default e=Anthropic API key is missing. Pass it using the 'apiKey' parameter or the ANTHROPIC_API_KEY environment variable. rejection INFO 2025-11-24T12:38:57 +0ms service=bus type=session.updated publishing INFO 2025-11-24T12:38:57 +0ms service=bus type=session.diff publishing INFO 2025-11-24T12:38:57 +0ms service=session.compaction pruned=0 total=0 found and this is my opencode.json (took your and just kept what i needed) { "$schema": "https://opencode.ai/config.json", "provider": { "azure-custom": { "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}" } }, "options": { "thinking": { "type": "enabled", "budgetTokens": 16000, } }, }, "claude-sonnet-4-5": { "id": "claude-sonnet-4-5", "provider": { "npm": "@ai-sdk/anthropic", "options": { "apiKey": "{env:ANTHROPIC_FOUNDRY_API_KEY}", "baseURL": "{env:ANTHROPIC_FOUNDRY_BASE_URL}" } }, "options": { "thinking": { "type": "enabled", "budgetTokens": 16000, } }, }, } }, } }
Author
Owner

@niusnet commented on GitHub (Nov 24, 2025):

Hello, this configuration works according to my tests

Image
{
	"$schema": "https://opencode.ai/config.json",
	"provider": {
		"azure-anthropic": {
			"name": "Azure AI Foundry (Anthropic)",
			"npm": "@ai-sdk/anthropic",
			"api": "{env:ANTHROPIC_FOUNDRY_BASE_URL}",
			"env": ["ANTHROPIC_FOUNDRY_API_KEY"],
			"models": {
				"claude-sonnet-4-5": {
					"id": "claude-sonnet-4-5",
					"name": "Claude Sonnet 4.5",
					"tool_call": true,
					"attachment": true,
					"reasoning": true,
					"temperature": true,
					"options": {
						"thinking": {
							"type": "enabled",
							"budgetTokens": 16000
						}
					}
				},
				"claude-haiku-4-5": {
					"id": "claude-haiku-4-5",
					"name": "Claude Haiku 4.5",
					"tool_call": true,
					"attachment": true,
					"reasoning": true,
					"temperature": true,
					"options": {
						"thinking": {
							"type": "enabled",
							"budgetTokens": 16000
						}
					}
				}
			}
		}
	}
}

@niusnet commented on GitHub (Nov 24, 2025): Hello, this configuration works according to my tests <img width="988" height="618" alt="Image" src="https://github.com/user-attachments/assets/203c6abb-808a-4e85-a2c1-88da5e2d9622" /> ````json { "$schema": "https://opencode.ai/config.json", "provider": { "azure-anthropic": { "name": "Azure AI Foundry (Anthropic)", "npm": "@ai-sdk/anthropic", "api": "{env:ANTHROPIC_FOUNDRY_BASE_URL}", "env": ["ANTHROPIC_FOUNDRY_API_KEY"], "models": { "claude-sonnet-4-5": { "id": "claude-sonnet-4-5", "name": "Claude Sonnet 4.5", "tool_call": true, "attachment": true, "reasoning": true, "temperature": true, "options": { "thinking": { "type": "enabled", "budgetTokens": 16000 } } }, "claude-haiku-4-5": { "id": "claude-haiku-4-5", "name": "Claude Haiku 4.5", "tool_call": true, "attachment": true, "reasoning": true, "temperature": true, "options": { "thinking": { "type": "enabled", "budgetTokens": 16000 } } } } } } }
Author
Owner

@cloonix commented on GitHub (Nov 25, 2025):

Hello, this configuration works according to my tests
[...]

I can confirm. Worked for me.

@cloonix commented on GitHub (Nov 25, 2025): > Hello, this configuration works according to my tests > [...] I can confirm. Worked for me.
Author
Owner

@krishna1s commented on GitHub (Nov 25, 2025):

Does it work irrespective of foundry deployment name ?

@krishna1s commented on GitHub (Nov 25, 2025): Does it work irrespective of foundry deployment name ?
Author
Owner

@niusnet commented on GitHub (Nov 25, 2025):

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.

@niusnet commented on GitHub (Nov 25, 2025): 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.
Author
Owner

@rekram1-node commented on GitHub (Nov 25, 2025):

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

@rekram1-node commented on GitHub (Nov 25, 2025): do we need to update models.dev was it incorrect?
Author
Owner

@cloonix commented on GitHub (Nov 27, 2025):

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"
  }
}
@cloonix commented on GitHub (Nov 27, 2025): 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. ```json "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`: ```json { "azure-anthropic": { "type": "api", "key": "xyz" } } ```
Author
Owner

@lasficw commented on GitHub (Jan 5, 2026):

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?

@lasficw commented on GitHub (Jan 5, 2026): > 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" > } > } This works great in the Terminal but not on the Web UI for some reason. Has anybody found a workaround for that?
Author
Owner

@bluet commented on GitHub (Jan 13, 2026):

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?

@bluet commented on GitHub (Jan 13, 2026): 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?
Author
Owner

@jonas-lomholdt commented on GitHub (Jan 30, 2026):

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

@jonas-lomholdt commented on GitHub (Jan 30, 2026): > 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" > } > } 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`
Author
Owner

@FaresKi commented on GitHub (Feb 2, 2026):

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)

@FaresKi commented on GitHub (Feb 2, 2026): 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)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2956