Skip to content

Conversation

@echozyr2001
Copy link

This PR introduces a new Credentials struct that consolidates API key and base URL
configuration, enabling simpler client initialization. The main benefits are:

  • Single container for auth and URL settings
  • Environment-based configuration in one step via OpenAI::from_env()
  • Cleaner credential management with OpenAI::from_credentials()
  • Full backward compatibility with existing code

Environment variables:

  • OPENAI_API_KEY (required): Your API key
  • OPENAI_API_URL (optional): API base URL, defaults to "https://api.openai.com/v1/"
  • OPENAI_ORGANIZATION (optional): Organization ID

This change improves the developer experience while maintaining all existing functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant