Skip to content

⚙️ OpenAI Provider Setup

Integrate OpenAI's models with Flexpilot, an AI code assistant in VS Code that functions like GitHub Copilot. Here’s a quick guide to get started!

🔑 Getting API Key

  1. Go to the OpenAI Platform and sign in (or create an account if you haven’t already).
  2. Navigate to API Keys in the account settings.
  3. Click Create new secret key and give it a name (optional but helpful).
  4. copy the key immediately — it won’t be visible again!

NOTE

Keep your API key secure! Never share it publicly.

🛠️ Configuration

  1. Access Flexpilot settings from VS Code:

    • Press Ctrl+Shift+P (Windows) or Cmd+Shift+P (Mac).
    • Select Flexpilot: Configure the Language Model Provider.
    • Choose Add New Configuration.
    • Select OpenAI (options: openai-chat or openai-completion).
  2. Enter a nickname when prompted. Pressing Escape will cancel the model configuration.

  3. Enter your API Key when prompted.

  4. Enter the OpenAI base URL when prompted. The default value is https://api.openai.com/v1. Use a different URL value for API calls if required, such as for proxy servers, gateways, etc.

  5. Enter your OpenAI Organization (optional). This can be left blank if you do not have one. This is the same organization found in your OpenAI Platform account settings.

  6. Enter your OpenAI Project (optional). This can be left blank if you do not have one. This is the same project found in your OpenAI Platform account settings.

  7. Select your preferred OpenAI model from the auto-populated list of models.

NOTE

Ensure that your API Key and Organization ID (if provided) have appropriate access to the selected OpenAI models. Visit OpenAI Console to manage your credentials.

📌 Important Notes

  • 💳 Usage Costs: API billing is based on tokens processed (input & output). Review OpenAI's pricing for details.
  • 💼 Model Limits: New accounts may start with lower usage limits, which can increase over time based on usage.

🚫 Troubleshooting

  • Authentication Issues: Double-check that your API key is entered correctly.
  • Credit Balance: Ensure there’s enough balance on your account for uninterrupted API access.
  • Usage Limits: Verify you haven’t exceeded your daily/monthly limits.

For detailed information, visit OpenAI’s documentation.