Settings ยท API Keys
API Key Management
Generate and manage API keys for programmatic access to your fine-tuned models. Keep them secure and rotate them regularly.
Keep API keys secure. Treat them like passwords. Never commit them to version control or share them publicly.
Your API Keys (0)
Usage Example
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.meshinfer.io/v1/models/infer \
-d '{"prompt": "Hello", "model": "llama-3.2-3b"}'Authentication
Include your API key in the Authorization header of HTTP requests:
Authorization: Bearer sk_production_xxxxx
Making Requests
Endpoint: https://api.meshinfer.io/v1/models/infer
Method: POST
Content-Type: application/json
Request Body
{
"model": "llama-3.2-3b",
"prompt": "What is the capital of France?",
"max_tokens": 256,
"temperature": 0.7,
"top_p": 0.9
}Example Response
{
"id": "cmpl_xxx",
"object": "text_completion",
"created": 1713618023,
"model": "llama-3.2-3b",
"choices": [
{
"text": "The capital of France is Paris.",
"index": 0,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 8,
"total_tokens": 16
}
}Best Practices
- โRotate API keys every 90 days for security
- โUse different keys for development, staging, and production
- โStore keys in environment variables, not in code
- โMonitor API key usage regularly for unauthorized access
- โRevoke keys immediately if compromised
Rate Limiting
API requests are rate limited based on your subscription plan. Check the response headers for current limits:
- X-RateLimit-Limit: 1000
- X-RateLimit-Remaining: 999
- X-RateLimit-Reset: 1713618083
