Coder powers secure, scalable development across key industries — automotive, finance, government, and technology — enabling faster builds, tighter compliance, and seamless AI adoption in enterprise-grade cloud environments.
# Your personal provider API key, forwarded to the upstream provider.
export OPENAI_API_KEY="<your-openai-api-key>"
# Your Coder API token, used for authentication with AI Gateway.
export CODER_API_TOKEN="<your-coder-api-token>"
Pre-configuring in Templates
Commit the profile to your repository at .junie/models/ai-gateway.json and
inject the token from the template, so users get a working configuration without
manual setup:
data "coder_workspace_owner" "me" {}
data "coder_workspace" "me" {}
resource "coder_env" "coder_api_token" {
agent_id = coder_agent.main.id
name = "CODER_API_TOKEN"
value = data.coder_workspace_owner.me.session_token
}
Reference the deployment URL in the profile with
${data.coder_workspace.me.access_url}/api/v2/ai-gateway/openai/v1/responses
if you generate the file from the template instead of committing it.