Get Agent Details
Retrieve detailed information about a specific AI agent by its ID.
Endpoint
GET /api/v1/agents/agent/{agentId}
Authentication
This endpoint requires API key authentication. Include your API key in the Authorization header using the Bearer scheme.
Header Format:
Authorization: Bearer {PUBLIC_KEY}:{SECRET_KEY}
Request
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string (UUID) | Yes | The unique identifier of the agent |
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Your API key in the format Bearer pk_xxx:sk_xxx |
Query Parameters
This endpoint does not accept any query parameters.
Response
Success Response
Status Code: 200 OK
Response Body:
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Customer Support Agent",
"description": "AI agent for handling customer inquiries",
"system_prompt": "You are a helpful customer support assistant...",
"slug": "customer-support",
"language": "en",
"model": {
"name": "gpt-4",
"display_name": "GPT-4",
"pricing": {
"input_per_1k_tokens": 0.03,
"output_per_1k_tokens": 0.06
},
"context_window": 8192
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"url": "https://agentsgt.com/api/v1/agents/basic/550e8400-e29b-41d4-a716-446655440000"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the request was successful |
data | object | The agent object |
data.id | string (UUID) | Unique identifier for the agent |
data.name | string | Name of the agent |
data.description | string | null | Description of the agent's purpose |
data.system_prompt | string | null | The system prompt that defines the agent's behavior |
data.slug | string | null | URL-friendly identifier for the agent |
data.language | string | null | Primary language of the agent |
data.model | object | Information about the AI model used |
data.model.name | string | Internal name of the model |
data.model.display_name | string | Human-readable name of the model |
data.model.pricing | object | Pricing information for the model |
data.model.pricing.input_per_1k_tokens | number | Cost per 1,000 input tokens (in USD) |
data.model.pricing.output_per_1k_tokens | number | Cost per 1,000 output tokens (in USD) |
data.model.context_window | number | Maximum context window size in tokens |
data.created_at | string (ISO 8601) | Timestamp when the agent was created |
data.updated_at | string (ISO 8601) | Timestamp when the agent was last updated |
data.url | string | Direct API URL to interact with this agent |
Error Responses
401 Unauthorized
Status: 401 Unauthorized
Body: "Unauthorized"
404 Not Found
Status: 404 Not Found
Body: "Agent not found"
500 Internal Server Error
Status: 500 Internal Server Error
Body: "Internal server error"
Example Usage
cURL
curl -X GET https://agentsgt.com/api/v1/agents/agent/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer pk_1234567890abcdef:sk_abcdef1234567890"
JavaScript (Fetch API)
const publicKey = 'pk_1234567890abcdef';
const secretKey = 'sk_abcdef1234567890';
const agentId = '550e8400-e29b-41d4-a716-446655440000';
fetch(`https://agentsgt.com/api/v1/agents/agent/${agentId}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${publicKey}:${secretKey}`,
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => {
console.log('Agent:', data.data.name);
console.log('Model:', data.data.model.display_name);
console.log('Language:', data.data.language);
})
.catch(error => {
console.error('Error:', error);
});
Python (Requests)
import requests
public_key = 'pk_1234567890abcdef'
secret_key = 'sk_abcdef1234567890'
agent_id = '550e8400-e29b-41d4-a716-446655440000'
headers = {
'Authorization': f'Bearer {public_key}:{secret_key}',
'Content-Type': 'application/json'
}
response = requests.get(
f'https://agentsgt.com/api/v1/agents/agent/{agent_id}',
headers=headers
)
if response.status_code == 200:
data = response.json()
agent = data['data']
print(f"Agent: {agent['name']}")
print(f"Model: {agent['model']['display_name']}")
print(f"Language: {agent['language']}")
else:
print(f"Error: {response.status_code} - {response.text}")
Node.js (Axios)
const axios = require('axios');
const publicKey = 'pk_1234567890abcdef';
const secretKey = 'sk_abcdef1234567890';
const agentId = '550e8400-e29b-41d4-a716-446655440000';
axios.get(`https://agentsgt.com/api/v1/agents/agent/${agentId}`, {
headers: {
'Authorization': `Bearer ${publicKey}:${secretKey}`,
'Content-Type': 'application/json'
}
})
.then(response => {
const agent = response.data.data;
console.log(`Agent: ${agent.name}`);
console.log(`Model: ${agent.model.display_name}`);
console.log(`Language: ${agent.language}`);
})
.catch(error => {
console.error('Error:', error.response?.data || error.message);
});
Notes
- The agent must belong to the organization associated with your API key
- Returns a single agent object rather than an array
- Includes the agent's language setting, which is not returned by the list agents endpoint
- The
urlfield provides a direct link to the basic message endpoint for this agent
Related Endpoints
- Get All Agents - List all agents in your organization
- Send Message - Send a message to an agent
- Chat - Start a streaming chat conversation