SDK Overview
AgentGate provides official SDKs to simplify integration.
Available SDKs
Why Use an SDK?
SDKs provide advantages over direct HTTP calls:
| Feature | SDK | HTTP |
|---|
| Type safety | Full types | Manual |
| Error handling | Typed errors | Parse JSON |
| Retries | Built-in | Manual |
| Rate limiting | Automatic | Manual |
| Pagination | Helper methods | Manual |
Quick Comparison
import { AgentGate } from '@agentgate/sdk';
const client = new AgentGate({
apiKey: process.env.AGENTGATE_API_KEY
});
const workOrder = await client.workOrders.create({
taskPrompt: "Add error handling",
workspaceSource: {
type: "git",
repository: "https://github.com/org/repo"
}
});
const response = await fetch(
'https://agentgate.mynewapi.com/v1/work-orders',
{
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.AGENTGATE_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
taskPrompt: "Add error handling",
workspaceSource: {
type: "git",
repository: "https://github.com/org/repo"
}
})
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.error.message);
}
const workOrder = await response.json();
REST API
If there’s no SDK for your language, use the REST API directly:
Community-maintained SDKs may be available for other languages. These are not officially supported by AgentGate.
Community SDKs may not be up to date with the latest API changes.