Create a key, choose an available model and make your first request through a compatible API.
1. Prepare your account and API key
Sign in and create a project key under API keys. Choose the appropriate group and quota. Use the key only in server programs or trusted local tools.
2. Set the API URL
Use the base URL below for this deployment. When moving to a server, replace the origin with your Yunhai domain and keep the /v1 suffix.
bash
export YUNHAI_API_KEY="YOUR_API_KEY"
export YUNHAI_BASE_URL="http://localhost:3187/v1"3. Send your first request
Replace YOUR_MODEL_ID with a real model ID available to your key.
bash
curl http://localhost:3187/v1/chat/completions \
-H "Authorization: Bearer $YUNHAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_MODEL_ID","messages":[{"role":"user","content":"Hello"}]}'4. Check the result
A successful Chat Completions response contains choices. Check requests, tokens and charges in usage records. For errors, keep the status code and consult troubleshooting.