API keys and credentials
Find and configure your provider API key, OPENAI_API_KEY, authentication and server environment variables.
The direct provider examples need a key from your provider account. A Zhivex account or key is not needed for a direct OpenAI adapter. Sign in to the OpenAI API keys page to manage an existing key. Account permissions and billing determine which models you can call.
Configure the server environment
The value below is a placeholder, not a working credential:
export OPENAI_API_KEY="replace-with-your-provider-key"
export ZHIVEX_MODEL="replace-with-a-model-available-to-your-account"
Keep secrets in server environment variables or your secret manager. Never commit them or expose them through PUBLIC_ or NEXT_PUBLIC_. Bun reads a local .env; Node can use shell exports (or --env-file on supported Node versions). Add .env to .gitignore if you use one.
Check without spending
TypeScript setup verification imports the packages locally. The Python quickstart runs a mock agent without a provider. Neither calls a paid model. The provider-backed examples make billable calls; only run them when you are ready.
Common errors
- Missing key: export the variable in the same terminal used to run the file; restart a server after changing its environment.
- Authentication / 401: check the provider account and whether the key was revoked. Do not paste the key into logs or support messages.
- Model unavailable / 404: select a model your provider account can access.
- Quota / 429: check provider billing and rate limits before retrying; repeated calls may incur charges.
Continue with TypeScript, Python, or the Gateway guide for a gateway-specific connection.