Give each application a separate key to keep permissions and costs attributable.
Create a key
Open API keys, enter a name, choose a group and set a quota for the project. Applications cannot authenticate with a disabled or deleted key.
Authenticate requests
http
Authorization: Bearer YOUR_API_KEYThe model gateway uses API keys. A console session token cannot replace a model API key.
Protect your keys
- Supply keys through environment variables or a secret manager.
- Do not put keys in public repositories, webpage source or shared screenshots.
- If you notice unexpected usage, disable the old key, create a replacement and update your application.
List available models
bash
curl http://localhost:3187/v1/models -H "Authorization: Bearer $YUNHAI_API_KEY"