Skip to main content

Overview

The Moda Gateway requires two types of authentication:
  1. Moda API Key - Identifies your application to Moda
  2. Provider API Key - Your key for the LLM provider (OpenAI, Anthropic, etc.)

Moda API Key

Include your Moda API key in the Authorization header:
curl https://api.example.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_MODA_API_KEY"
Contact your administrator to get a Moda API key.

Provider API Keys

You also need to provide credentials for the LLM provider you are using.

OpenAI and Anthropic

Pass your provider key in the X-Provider-Key header:
curl https://api.example.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_MODA_API_KEY" \
  -H "X-Provider-Key: YOUR_OPENAI_KEY" \
  -d '{"model": "gpt-4o@@openai", ...}'

AWS Bedrock

For AWS Bedrock, pass your AWS credentials in headers. Note that Bedrock requires the native Anthropic request format with anthropic_version:
curl https://api.example.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_MODA_API_KEY" \
  -H "X-AWS-Access-Key-Id: YOUR_ACCESS_KEY" \
  -H "X-AWS-Secret-Access-Key: YOUR_SECRET_KEY" \
  -H "X-AWS-Region: us-east-1" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic.claude-sonnet-4-5-20250929-v1:0@@bedrock",
    "anthropic_version": "bedrock-2023-05-31",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
Optional headers for AWS:
  • X-AWS-Session-Token - For temporary credentials
  • X-AWS-Region - Defaults to us-east-1 if not specified

Security best practices

Never commit API keys to source control. Use environment variables or a secrets manager.
  • Store API keys in environment variables
  • Rotate keys regularly
  • Use separate keys for development and production
  • Monitor usage for unexpected activity