aurarouter-openai
OpenAI Platform and Azure OpenAI MCP provider server for AuraRouter.
aurarouter-openai exposes OpenAI and Azure OpenAI models as an MCP (Model Context Protocol) provider server compatible with the AuraRouter Provider Protocol. It separates cloud vendor specifics (such as reasoning model dialects, /v1/responses, Structured Outputs, and prompt caching) from AuraRouter core's generic local OpenAPIProvider.
Features
- Standard MCP Provider Protocol:
provider.generate: Single-shot text generationprovider.generate_with_history: Multi-turn conversational generationprovider.list_models: Catalog discovery with context limits, pricing, and capabilitiesprovider.health_check: Liveness and credential readiness probeprovider.capabilities: Tool and feature advertisement
- Reasoning Model Dialect Adaptation:
- Automatically switches
o1,o3,o4-mini, andgpt-5*models tomax_completion_tokens. - Maps system instructions to the
developerrole. - Supports
reasoning_effort(low,medium,high) and suppresses unsupportedtemperatureparameters.
- Automatically switches
- Dual API Modes:
- Chat Completions:
/v1/chat/completions(default) - Responses API:
/v1/responses(api_mode="responses")
- Chat Completions:
- Azure OpenAI Support:
- Configurable
azure_endpoint,api_version, and deployment routing. - Supports both
api-keyheader authentication and Microsoft Entra ID (AZURE_OPENAI_AD_TOKEN).
- Configurable
- Prompt Cache Affinity:
- Passes
prompt_cache_keyto upstream endpoints. - Returns
cached_input_tokensandreasoning_tokenstelemetry.
- Passes
- AuraRouter v2.1 Telemetry Envelopes:
- Normalizes Go-duration rate limit headers (
x-ratelimit-*) andRetry-After. - Propagates typed error envelopes:
rate_limit_exceeded,context_length_exceeded, andprovider_transient_error.
- Normalizes Go-duration rate limit headers (
Installation
pip install aurarouter-openai
Or install from source:
cd aurarouter-openai
pip install -e .
Configuration
Environment Variables
| Variable | Description |
|---|---|
OPENAI_API_KEY |
OpenAI API key (or Azure OpenAI API key) |
OPENAI_BASE_URL |
Optional custom base URL (default: https://api.openai.com/v1) |
OPENAI_ORG_ID |
Optional OpenAI organization ID |
OPENAI_PROJECT_ID |
Optional OpenAI project ID |
AZURE_OPENAI_ENDPOINT |
Azure OpenAI resource endpoint (e.g. https://my-resource.openai.azure.com) |
AZURE_OPENAI_AD_TOKEN |
Optional Microsoft Entra ID bearer token for Azure OpenAI |
OPENAI_API_VERSION |
Azure OpenAI API version (default: 2025-01-01-preview) |
Running the Server
Start the standalone MCP server:
python -m aurarouter_openai
Display command line options and help:
python -m aurarouter_openai --help
AuraRouter Integration
In your AuraRouter configuration file (auraconfig.yaml):
models:
gpt-4o:
provider: mcp
mcp_endpoint: http://localhost:8000
model_name: gpt-4o
hosting_tier: cloud
cost_per_1m_input: 2.50
cost_per_1m_output: 10.00
context_limit: 128000
o3:
provider: mcp
mcp_endpoint: http://localhost:8000
model_name: o3
hosting_tier: cloud
cost_per_1m_input: 2.00
cost_per_1m_output: 8.00
context_limit: 200000
Testing & Verification
The test suite supports standalone execution and monorepo runner integration:
pytest tests/ -v
- Unit & Telemetry Suite: Verifies client lifecycle, dialect transformation, rate-limit header parsing, and error encapsulation.
- Canary Suite: Includes
@pytest.mark.live_vendorcanaries with strict token caps (max_tokens=16) to verify live OpenAI Platform connectivity whenOPENAI_API_KEYis present.
License
MIT License. See LICENSE for details.
Metadata
Release files for aurarouter-openai 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aurarouter_openai-0.5.1.tar.gz | 20.2 kB | With provenance | Details for aurarouter_openai-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aurarouter_openai-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for aurarouter_openai-0.5.1-py3-none-any.whl |
Total release size: 35.8 kB
Release files / aurarouter_openai-0.5.1.tar.gz
| Download URL | aurarouter_openai-0.5.1.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfaedd893ea2a27d0c42e598d2baad30614626d62e862220c3e2c153f35f1fc8
|
|
BLAKE2b-256 checksum How to use checksums |
11879113627db10bbf48cd7260f559a335031a67d8846905bcae24f8da9b931b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logRelease files / aurarouter_openai-0.5.1-py3-none-any.whl
| Download URL | aurarouter_openai-0.5.1-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0af41465ca64843ad9d663cdbe52a7c97015a92f9b600ad1983d8695d5b5f845
|
|
BLAKE2b-256 checksum How to use checksums |
0b8feb0caca8a800dd93da835b81f0d87ee0ab946f4256c41b8b0e13ccc7ee17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logSecurity for aurarouter-openai 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for aurarouter_openai-0.5.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.