Using OpenAI API key built with azure
Hi, I'm trying to setup my azure open ai api key but it's coming as Invalid api key.
This is how I put it in .env
OPENAI_API_KEY=key ROUTER_DEFAULT=azure/gpt-5
can you help me to setup this.
We haven't tested with Azure OpenAI, but technically it should work with the following changes
- You can try adding this to the Providers in the router-config.json and use the
.envyou have mentioned
{
"name": "azure",
"api_base_url": "https://your-azure-chat-completion-base-url/v1/chat/completions",
"api_key": "$OPENAI_API_KEY",
"models": ["gpt-5.2", "gpt-5-mini"],
"transformer": {
"use": [["maxcompletiontokens", { "max_completion_tokens": 16384 }]]
}
}
- Deploy
gpt-5.2andgpt-5-minimodels in Azure OpenAI in order to use them - Let us know if you were able to run Shannon successfully using Azure OpenAI. If so we can add it to the
README.md, so that it will be helpful for other users as well
Nope getting same error invalid api key let me do bit of troubleshoot seems like it's not taking my api key
Hi, I explored this problem and it a requires a lot of efforts to find the solution. Here are my observations so far:
- The codebase doesn't support reasoning models as they use responses api. The code is configured to use chat/completions api, so the latest model that supports it is gpt-4.1.
- The current OpenAI implementation won't be able to support the Azure OpenAI architecture, and the code given above doesn't solve the issue.
I am working on a solution, but for some reason the Pre recon agent is not saving the pre_recon_deliverable.md file in the correct, due to which the recon agent is failing. Once I am able to get the agents running successfully, I can open a PR with the implementation.
As we mentioned in our README, the Claude Code router is unsupported and is intended as an off-ramp for community-focused exploration of other models. We've noticed a lot of variance using non-Anthropic outside of our default. We are built on the Anthropic harness and, for now, are optimized only for Anthropic models.
hello, Has this issue been resolved? Can the Azure Anthropic key be used? Thank you
hello, Has this issue been resolved? Can the Azure Anthropic key be used? Thank you
Hi, I did get the tool to work with Azure OpenAI GPT 5.2. But it requires a quite few changes in the codebase, and also when the final output is compared to one generated with the Claude Model, the reports are very inferior. Didn't feel the efforts where worth it.
hello, Has this issue been resolved? Can the Azure Anthropic key be used? Thank you
Hi, I did get the tool to work with Azure OpenAI GPT 5.2. But it requires a quite few changes in the codebase, and also when the final output is compared to one generated with the Claude Model, the reports are very inferior. Didn't feel the efforts where worth it.
Okay, thank you for your reply, brother
hello, Has this issue been resolved? Can the Azure Anthropic key be used? Thank you
Hi, I did get the tool to work with Azure OpenAI GPT 5.2. But it requires a quite few changes in the codebase, and also when the final output is compared to one generated with the Claude Model, the reports are very inferior. Didn't feel the efforts where worth it.
Okay, thank you for your reply, brother
Let me know if you need the implementation method. I can list out the steps needed to be followed.
@Aman-Haris-855 yes please share the steps
@Aman-Haris-855 yes please share the steps
Please apply the following configuration updates.
1. Update configs/router-config.json
Under the OpenAI providers section, update the following parameters:
api_base_url
https://<your_service_name>.cognitiveservices.azure.com/openai/deployments/gpt-5.2/chat/completions?api-version=2025-01-01-preview
Replace the OpenAI API key entry with
$AZURE_API_KEY
models
["gpt-5.2"]
use
[["maxcompletiontokens", { "max_completion_tokens": 128000 }]]
2. Update docker-compose.yml
Under the environment section, update the following variables:
Replace the OpenAI API key entry with:
- AZURE_API_KEY=${AZURE_API_KEY:-}
Update the router default model:
- ROUTER_DEFAULT=${ROUTER_DEFAULT:-openai,gpt-5.2}
Update the maximum output tokens:
- CLAUDE_CODE_MAX_OUTPUT_TOKENS=${CLAUDE_CODE_MAX_OUTPUT_TOKENS:-128000}
3. Update shannon
Replace:
$OPENAI_API_KEY
with:
$AZURE_API_KEY
4. Update .env
Add or update the following variables:
CLAUDE_CODE_MAX_OUTPUT_TOKENS=128000
AZURE_API_KEY= (your api key)
ROUTER_DEFAULT=openai,gpt-5.2
5. Update Prompt Files (only if required)
Affected files:
prompts/exploit-auth.txt
prompts/exploit-authz.txt
prompts/exploit-injection.txt
prompts/exploit-ssrf.txt
prompts/exploit-xss.txt
prompts/recon.txt
prompts/report-executive.txt
prompts/vuln-auth.txt
prompts/vuln-authz.txt
prompts/vuln-injection.txt
prompts/vuln-ssrf.txt
prompts/vuln-xss.txt
Replace:
pre_recon_deliverable.md
with:
code_analysis_deliverable.md
⚠️ Only apply this change if you encounter the error:
code_analysis_deliverable.md file not found
from the recon agent.