pydo.dedicated_inferences.create_tokens()

Generated on 3 Aug 2026 from pydo version v0.40.0

Usage

client.dedicated_inferences.create_tokens(
    dedicated_inference_id="6b5c619c-359c-44ca-87e2-47e98170c01d",
    body={
        "name": "new-inference-token",
    },
)
Returns JSONRaises HttpResponseError

Description

Create a new access token for a Dedicated Inference instance. Send a POST request to /v2/dedicated-inferences/{dedicated_inference_id}/tokens with a name. The token value is returned only once in the response; store it securely.

Parameters

dedicated_inference_id string required

A unique identifier for a Dedicated Inference instance.

name string required

Example: new-inference-token

Name for the new token.

Max length: 255

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "name": "new-inference-token"
}

resp = client.dedicated_inferences.create_tokens(dedicated_inference_id="6b5c619c-359c-44ca-87e2-47e98170c01d", body=req)

Response Example

Show Response Example
{
  "token": {
    "id": "01333f14-a903-4b8e-92b3-363a767aa052",
    "name": "first-token",
    "value": "di_xxxxxxxxxxxxxxxxxxxxxxxx",
    "created_at": "2024-01-09T20:44:32Z",
    "is_managed": false
  }
}

More Information

See /v2/dedicated-inferences/{dedicated_inference_id}/tokens in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.