Skip to main content

API Reference

Welcome to the AgentsGT API documentation. This API allows you to programmatically interact with your AI agents, retrieve chat history, and access usage metrics.

Base URL

All API requests should be made to:

https://agentsgt.com/api/v1

Authentication

AgentsGT uses API keys for authentication. You can create and manage API keys from your organization's settings page.

API Key Format

API keys consist of two parts:

  • Public Key: Starts with pk_ (can be safely stored in client-side code)
  • Secret Key: Starts with sk_ (must be kept secure and never exposed)

Using Your API Key

Include your API key in the Authorization header of each request:

Authorization: Bearer {PUBLIC_KEY}:{SECRET_KEY}

Example:

Authorization: Bearer pk_1234567890abcdef:sk_abcdef1234567890

Rate Limiting

API keys can have rate limits configured per organization. If you exceed your rate limit, you'll receive a 429 Too Many Requests response.

Response Format

All API responses are returned in JSON format with the following structure:

Success Response:

{
"success": true,
"data": { ... }
}

Error Response:

{
"success": false,
"error": "Error message"
}

Common HTTP Status Codes

Status CodeDescription
200Success - Request completed successfully
400Bad Request - Invalid request parameters
401Unauthorized - Invalid or missing API key
403Forbidden - API key doesn't have permission
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong on our end

Available Endpoints

Agents

Chat History

Metrics

Best Practices

  1. Secure Your API Keys: Never commit secret keys to version control or expose them in client-side code
  2. Use Environment Variables: Store API keys in environment variables, not in your code
  3. Handle Errors Gracefully: Always check response status codes and handle errors appropriately
  4. Monitor Usage: Keep track of your API usage to avoid hitting rate limits
  5. Update Last Used: API keys automatically track when they were last used for security purposes