Environment Setup
Recommended approach
For Codebyby relay access, prefer environment variables for both the base URL and API key. This makes domain rotation, key replacement, and multi-environment switching easier to manage.
What you usually need to configure
Exact names differ by client, but you usually need to confirm two kinds of values:
- API base URL
- API key
If the client also requires a model name, organization identifier, or extra headers, verify those as well.
Configuration principles
- Use the relay address published by the current instance, not the upstream default host.
- Make sure the key belongs to the same deployment as the base URL.
- Prefer user-level environment variables or controlled config files.
- Never commit a real key to a repository, screenshot, or public log.
How to separate multiple environments
If you maintain development, staging, and production environments, it is safer to:
- use different config files or variable prefixes
- reconfirm the active base URL before switching
- keep a lightweight smoke test for validation after each change
Where to look first when something breaks
- Whether the environment variables are actually loaded
- Whether the client is reading the config file you expect
- Whether the path prefix is missing
- Whether an old key or old domain is still cached somewhere