Skip to content

Update_Model_Api_Key #41983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update_Model_Api_Key #41983

wants to merge 1 commit into from

Conversation

w-javed
Copy link
Contributor

@w-javed w-javed commented Jul 11, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 11, 2025 06:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the HTTP header key used for passing the API key from "api-key" to "model-api-key" across sample code and documentation.

  • Replaces "api-key" with "model-api-key" in both sync and async samples for red-team and evaluation workflows.
  • Updates the README sample snippet to reflect the new header name.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdk/ai/azure-ai-projects/samples/red_team/sample_red_team_async.py Updated header key to "model-api-key".
sdk/ai/azure-ai-projects/samples/red_team/sample_red_team.py Updated header key to "model-api-key".
sdk/ai/azure-ai-projects/samples/evaluation/sample_evaluations_async.py Updated header key to "model-api-key".
sdk/ai/azure-ai-projects/samples/evaluation/sample_evaluations_aoai_graders.py Updated header key to "model-api-key".
sdk/ai/azure-ai-projects/samples/evaluation/sample_evaluations.py Updated header key to "model-api-key".
sdk/ai/azure-ai-projects/README.md Updated sample code snippet with new header key.

@@ -71,7 +71,7 @@ async def sample_red_team_async() -> None:
red_team=red_team,
headers={
"model-endpoint": model_endpoint,
"api-key": model_api_key,
"model-api-key": model_api_key,
Copy link
Preview

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting the header key string 'model-api-key' into a shared constant (e.g. MODEL_API_KEY_HEADER) to avoid duplication across samples and minimize the risk of typos.

Suggested change
"model-api-key": model_api_key,
MODEL_API_KEY_HEADER: model_api_key,

Copilot uses AI. Check for mistakes.

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

Successfully merging this pull request may close these issues.

1 participant