OpenAI (GPT)
You can connect to GPT models via your ChatGPT subscription, or, via the API key. They are charged separately, and normal users are likely to use the ChatGPT subscription way.
ChatGPT subscription
Use a ChatGPT account with Codex access.
WARNING: Compatibility does not guarantee provider authorization or account safety. Use at your own risk.
1. Configure the provider
If ChatGPT subscription is already configured under Downstreams, skip to the next section 2. Connect.
- Web UI
- config.yaml
- Open Downstreams, click + Add Provider, then select the new provider in the list.
- Set its name to
ChatGPT subscription. Under API Formats, select only OpenAI Responses. - Set API Host to
https://chatgpt.com/backend-api/codex. - Open Advanced Host Settings. Under Per-format request paths, set the OpenAI Responses entry to
/responses. Leave Per-format URLs empty. - Under Authentication, select OAuth, then expand Advanced OAuth settings.
- Set Flow to Device Code (RFC 8628), then fill in:
| Field | Value |
|---|---|
| Device Auth URL | https://auth.openai.com/api/accounts/deviceauth/usercode |
| Device Token URL | https://auth.openai.com/api/accounts/deviceauth/token |
| Verify URL | https://auth.openai.com/codex/device |
| Device Redirect URI | https://auth.openai.com/deviceauth/callback |
| Token URL (code exchange) | https://auth.openai.com/oauth/token |
| Client ID | app_EMoamEEZ73f0CkXaXp7hrann |
- Leave Scopes and Extra Headers empty, all policy checkboxes unchecked, both numeric fields at
0, and Allowed endpoint hosts empty. Changes save automatically; no restart is needed. Continue to 2. Connect.
Add this entry to your existing downstreams list in config.yaml:
- id: chatgpt
name: ChatGPT subscription
api_formats: [openai_responses]
base_url: https://chatgpt.com/backend-api/codex
format_paths:
openai_responses: /responses
auth:
type: oauth
flow: device
device_auth_url: https://auth.openai.com/api/accounts/deviceauth/usercode
device_token_url: https://auth.openai.com/api/accounts/deviceauth/token
device_verify_url: https://auth.openai.com/codex/device
token_url: https://auth.openai.com/oauth/token
client_id: app_EMoamEEZ73f0CkXaXp7hrann
device_redirect_uri: https://auth.openai.com/deviceauth/callback
output_model_ids: [gpt-6-astra]
Restart Tresor, then continue to 2. Connect.
2. Connect
- Open Downstreams in the left sidebar, then click ChatGPT subscription in the provider list.
- Click Connect below that section. The device-login dialog displays a verification URL and a code.
- Open the displayed URL in your browser, sign in to your ChatGPT account, and enter the displayed code. Complete any approval prompts.
- Return to Tresor and wait for Connected below the Connect button.
- Under Models, click Fetch Models, then click Add beside each model you want. If discovery is unavailable, click + Add Model and enter an available Codex model ID.
To disconnect, click Disconnect beside Connect, then confirm.
OpenAI API
- Web UI
- config.yaml
Web UI is more intuitive, but requires more manual operations.
In the "Downstreams" tab:
- Click + Add Provider to create a separate API provider, then select it in the list.
- Enter
OpenAI APIas its name. - Under API Formats, select OpenAI and OpenAI Responses.
- Under Authentication, select API key and enter a key from OpenAI API Keys.
- Under API Host, enter
https://api.openai.com - Under Models, click Fetch Models, then + Add beside each model you need.
Editing YAML is less intuitive, but requires fewer manual operations.
Replace YOUR-OPENAI-API-KEY with your API key. The model ID below follows Tresor's example configuration; replace it with a model available to your account.
# Other settings omitted. Add this entry to your existing downstreams list.
downstreams:
- id: openai
name: OpenAI
base_url: https://api.openai.com
api_formats:
- openai
- openai_responses
output_model_ids:
- gpt-6-astra
is_enabled: true
auth:
type: api_key
api_key: YOUR-OPENAI-API-KEY
Restart Tresor to apply the YAML changes.
OpenAI does not expose native Anthropic Messages or Gemini endpoints. Do not enable those downstream formats for this provider.
Done! Clients accessing Tresor can now use your configured GPT models.