> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorone.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Endpoint

> Create a new serverless endpoint for AI model inference

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

```bash
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:

```json
{
    "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"
}
```

> [!NOTE]
>
> Endpoint creation is asynchronous. The endpoint will show `pending` status while being provisioned, then transition
> to `active` when ready to accept requests.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.