Create a new serverless endpoint that can execute your AI models on-demand. Endpoints are created from templates and can be scaled with multiple workers.
Required Parameters
name: Human-readable name for the endpoint (1-100 characters)
templateId: ID of the template to use for the endpoint
gpuIds: Array of GPU IDs to allocate to the endpoint
Optional Parameters
workerCount: Number of workers (1-10, default: 1)
Example Usage
curl -X POST "https://api.tensorone.ai/v2/endpoints" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "my-image-generator",
"templateId": "tpl_stable_diffusion_xl",
"gpuIds": ["gpu_nvidia_a100_1"],
"workerCount": 2
}'
Response
Returns the created endpoint object:
{
"id": "ep_1234567890abcdef",
"name": "my-image-generator",
"status": "pending",
"url": "https://api.tensorone.ai/v2/ep_1234567890abcdef/runsync",
"templateId": "tpl_stable_diffusion_xl",
"gpuType": "NVIDIA A100",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
Endpoint creation is asynchronous. The endpoint will show pending status while being provisioned, then transition
to active when ready to accept requests.