agentapi-proxy API
This skill provides guidance for interacting with the agentapi-proxy API using API Key authentication.
Authentication
agentapi-proxy supports multiple authentication methods. The most common are:
Method 1: X-API-Key Header (Recommended)
bash
curl -H "X-API-Key: YOUR_API_KEY" https://api.example.com/endpoint
Method 2: Authorization Bearer Token
bash
curl -H "Authorization: Bearer YOUR_API_KEY" https://api.example.com/endpoint
Core Workflows
Creating a Session
bash
curl -X POST https://api.example.com/start \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"environment": {
"GITHUB_TOKEN": "ghp_...",
"CUSTOM_VAR": "value"
},
"tags": {
"repository": "my-repo",
"branch": "main"
}
}'
Response:
json
{
"session_id": "550e8400-e29b-41d4-a716-446655440000"
}
Searching Sessions
bash
# List all sessions curl -H "X-API-Key: YOUR_API_KEY" \ https://api.example.com/search # Filter by status curl -H "X-API-Key: YOUR_API_KEY" \ "https://api.example.com/search?status=active" # Filter by tags curl -H "X-API-Key: YOUR_API_KEY" \ "https://api.example.com/search?tag.repository=my-repo&tag.branch=main"
Deleting a Session
bash
curl -X DELETE https://api.example.com/sessions/SESSION_ID \ -H "X-API-Key: YOUR_API_KEY"
Routing to Session
All requests to /:sessionId/* are proxied to the agentapi instance for that session:
bash
curl -H "X-API-Key: YOUR_API_KEY" \
https://api.example.com/SESSION_ID/message \
-X POST \
-H "Content-Type: application/json" \
-d '{"content": "Hello", "type": "user"}'
API Reference
For complete API endpoint documentation, permissions, and authentication details, see:
- •API_REFERENCE.md - Complete endpoint reference
- •AUTHENTICATION.md - Authentication methods and configuration
- •PERMISSIONS.md - Role-based access control details
Helper Scripts
Use scripts/agentapi_request.sh for quick API requests with automatic environment variable handling.