> For the complete documentation index, see llms.txt.
Skip to main content

Check out Port for yourself ➜ 

OpenAI setup

Connect Port to OpenAI's API to use models like gpt-5. This guide walks you through storing your API key and registering OpenAI as an LLM provider in Port.

Prerequisites

  • An active OpenAI account with API access.
  • An OpenAI API key. You can generate one in your OpenAI API keys page.

Step 1: Store your API key in Port secrets

Before configuring the provider, store your OpenAI API key in Port's secrets system.

  1. In your Port application, click on your profile picture .
  2. Click on Credentials.
  3. Click on the Secrets tab.
  4. Click on + Secret and add your secret(s).

For provider-specific secret requirements and examples, see Step 2: Store API Keys in Secrets.

Secret naming flexibility

You can choose any names for your secrets. The examples are suggestions. Use names that make sense for your organization, and reference the exact names in your provider configuration.

For more details on managing secrets, see the Port Secrets documentation.

Step 2: Register OpenAI with the Port API

Call the Create or connect an LLM provider API with validate_connection=true to test your configuration. Set provider to "openai" and reference the secret name you created in Step 1.

{
"provider": "openai",
"enabled": true,
"config": {
"apiKeySecretName": "openai-api-key"
}
}
Supported models

When you register OpenAI without specifying model overrides, Port validates all supported OpenAI models by default. If you only have access to specific models or want to limit which models are enabled, use the overrides field. See Model overrides for details.

Step 3: Validate the configuration

The validate_connection=true parameter tests your configuration by making a request to your provider. If validation succeeds, your provider configuration is saved. If it fails, check the error message for details.

For more troubleshooting steps, see the Setup & Configuration guide.

Common validation failures:

  • Invalid API key: Verify your API key is correct and active in your OpenAI account.
  • Insufficient quota: Ensure your OpenAI account has sufficient usage quota or credits.
  • Rate limit exceeded: Wait and retry if you've exceeded OpenAI's rate limits.

After registration

Once your provider is configured:

For more information on provider selection and validation flow, see Setup & Configuration.