API Authentication
The GeniSpace API uses API keys for identity authentication. All API requests must include valid authentication information in the request headers.
Obtaining an API Key
- Log in to the console, navigate to System → Service Integrations
- In the API Key management area, click "Create API Key"
- Store the generated key securely—the key is only displayed once at creation time
Usage
Add the Authorization field to the HTTP headers of each API request:
Authorization: Bearer YOUR_API_KEY
Request Example
curl -X GET https://api.genispace.cn/developer/api-agents \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json"
Security Recommendations
- Do not hardcode API keys in client-side code
- Use environment variables to store keys
- Rotate keys regularly
- If a key is compromised, immediately revoke it in the console and create a new one
Permission Scope
The permission scope of an API key depends on the creator's team role and subscription plan. The key can access resources belonging to the creator's team.
Related Documentation
- API Overview — API fundamentals
- API Endpoints — Available endpoint list
- Error Handling — Error code reference