Skip to main content

OpenAI (GPT)

[official website]

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.

  1. Open Downstreams, click + Add Provider, then select the new provider in the list.
  2. Set its name to ChatGPT subscription. Under API Formats, select only OpenAI Responses.
  3. Set API Host to https://chatgpt.com/backend-api/codex.
  4. Open Advanced Host Settings. Under Per-format request paths, set the OpenAI Responses entry to /responses. Leave Per-format URLs empty.
  5. Under Authentication, select OAuth, then expand Advanced OAuth settings.
  6. Set Flow to Device Code (RFC 8628), then fill in:
FieldValue
Device Auth URLhttps://auth.openai.com/api/accounts/deviceauth/usercode
Device Token URLhttps://auth.openai.com/api/accounts/deviceauth/token
Verify URLhttps://auth.openai.com/codex/device
Device Redirect URIhttps://auth.openai.com/deviceauth/callback
Token URL (code exchange)https://auth.openai.com/oauth/token
Client IDapp_EMoamEEZ73f0CkXaXp7hrann
  1. 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.

2. Connect​

  1. Open Downstreams in the left sidebar, then click ChatGPT subscription in the provider list.
  2. Click Connect below that section. The device-login dialog displays a verification URL and a code.
  3. Open the displayed URL in your browser, sign in to your ChatGPT account, and enter the displayed code. Complete any approval prompts.
  4. Return to Tresor and wait for Connected below the Connect button.
  5. 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 is more intuitive, but requires more manual operations.

In the "Downstreams" tab:

  1. Click + Add Provider to create a separate API provider, then select it in the list.
  2. Enter OpenAI API as its name.
  3. Under API Formats, select OpenAI and OpenAI Responses.
  4. Under Authentication, select API key and enter a key from OpenAI API Keys.
  5. Under API Host, enter https://api.openai.com
  6. Under Models, click Fetch Models, then + Add beside each model you need.

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.

Next step​