tensorone logo

SDKs

GraphQL Endpoints

Learn how to manage Endpoints using GraphQL.


Managing Serverless Endpoints

Required Arguments

  • gpuIds
  • name
  • templateId

All other arguments are optional and will use default values if omitted.


Create a Serverless Endpoint

curl --request POST \
--header 'content-type: application/json' \
--url 'https://api.tpu.one/graphql?api_key=${YOUR_API_KEY}' \
--data '{"query": "mutation { saveEndpoint(input: { gpuIds: \"AMPERE_16\", idleTimeout: 5, locations: \"US\", name: \"Generated Endpoint -fb\", networkVolumeId: \"\", scalerType: \"QUEUE_DELAY\", scalerValue: 4, templateId: \"xkhgg72fuo\", workersMax: 3, workersMin: 0 }) { gpuIds id idleTimeout locations name scalerType scalerValue templateId workersMax workersMin } }"}'

Modify an Existing Serverless Endpoint

curl --request POST \
--header 'content-type: application/json' \
--url 'https://api.tpu.one/graphql?api_key=${YOUR_API_KEY}' \
--data '{"query": "mutation { saveEndpoint(input: { id: \"i02xupws21hp6i\", gpuIds: \"AMPERE_16\", name: \"Generated Endpoint -fb\", templateId: \"xkhgg72fuo\", workersMax: 0 }) { id gpuIds name templateId workersMax } }"}'

View Your Endpoints

curl --request POST \
--header 'content-type: application/json' \
--url 'https://api.tpu.one/graphql?api_key=${YOUR_API_KEY}' \
--data '{"query": "query Endpoints { myself { endpoints { gpuIds id idleTimeout locations name networkVolumeId clusters { desiredStatus } scalerType scalerValue templateId workersMax workersMin } serverlessDiscount { discountFactor type expirationDate } } }"}'

Delete a Serverless Endpoint

Note: workersMin and workersMax must both be set to 0 to delete an Endpoint.

curl --request POST \
--header 'content-type: application/json' \
--url 'https://api.tpu.one/graphql?api_key=${YOUR_API_KEY}' \
--data '{"query": "mutation { deleteEndpoint(id: \"i02xupws21hp6i\") }"}'
Previous
GraphQL Templates Management