Skip to content
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

Does azure_api_key support this sdk? #7

Open
xinliqingpi opened this issue Dec 25, 2024 · 3 comments
Open

Does azure_api_key support this sdk? #7

xinliqingpi opened this issue Dec 25, 2024 · 3 comments

Comments

@xinliqingpi
Copy link

Does azure_api_key support this sdk?

@juberti-oai
Copy link

Not yet. Should be easy to add to http.cpp.

@HaoHoo
Copy link

HaoHoo commented Dec 28, 2024

add_compile_definitions(OPENAI_API_KEY="$ENV{OPENAI_API_KEY}")
add_compile_definitions(OPENAI_REALTIMEAPI="https://api.openai.com/v1/realtime?model=gpt-4o-mini-realtime-preview-2024-12-17")

Looks like that real-time model in Azure OpenAI uses WebSocket to connect to the service:
wss://my-eastus2-openai-resource.openai.azure.com/openai/realtime?api-version=2024-10-01-preview&deployment=gpt-4o-realtime-preview-deployment-name
(ref: https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/realtime-audio)

I guess that the model version is different and API is too.

Backend Selection

BACKEND=azure|openai

Azure OpenAI Configuration

AZURE_OPENAI_ENDPOINT=your-endpoint
AZURE_OPENAI_DEPLOYMENT=your-deployment

OpenAI Configuration

OPENAI_API_KEY=your-api-key
OPENAI_MODEL=your-model

@juberti-oai
Copy link

I think Azure just needs some slightly different HTTP headers, e.g., x-api-key instead of authorization, and a different base URL (openai.azure.com/blah instead of api.openai.com/blah)

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

No branches or pull requests

3 participants