Provider Api Key Injection

When a request is made to the provider, if a relevant api key environment value is found, the value is injected.

You don't need to do anything.

Example

If you start Aitm as a service with the OpenRouter Api Key OPENROUTER_API_KEY, the value will be injected in the Authorization header.

bash
OPENROUTER_API_KEY=$(pass /my/open/router/apikey) aitm start service
  • The proxy service will inject into all HTTP requests made against openrouter.ai/api the Authorization header
http
Authorization: Bearer MySecretApiKey

Work with rerouting

Note that because the injection happens after routing, it will work even if the original request was made against another provider.