Inference API

Account

View as Markdown


API key

/v1/api-key

Get information about an API key, including name, status, permissions and users who created or modified this key.

Response Body

aclsarray<string>

A list of ACLs authorized with the API key, e.g. `"api-key:endpoint:*"`, `"api-key:model:*"`.

api_key_blockedboolean

Indicates whether the API key is blocked.

api_key_disabledboolean

Indicates whether the API key is disabled.

api_key_idstring

ID of the API key.

create_timestring

Creation time of the API key in Unix timestamp.

modified_bystring

User ID of the user who last modified the API key.

modify_timestring

Last modification time of the API key in Unix timestamp.

namestring

The name of the API key specified by user.

redacted_api_keystring

The redacted API key.

team_blockedboolean

Indicates whether the team that owns the API key.

team_idstring

The team ID of the team that owns the API key.

user_idstring

User ID the API key belongs to.

Exampletext

text

No parameters.
Exampletext

text

{
  "redacted_api_key": "xai-...b14o",
  "user_id": "59fbe5f2-040b-46d5-8325-868bb8f23eb2",
  "name": "My API Key",
  "create_time": "2024-01-01T12:55:18.139305Z",
  "modify_time": "2024-08-28T17:20:12.343321Z",
  "modified_by": "3d38b4dc-4eb7-4785-ae26-c3fa8997ffc7",
  "team_id": "5ea6f6bd-7815-4b8a-9135-28b2d7ba6722",
  "acls": [
    "api-key:model:*",
    "api-key:endpoint:*"
  ],
  "api_key_id": "ae1e1841-4326-4b36-a8a9-8a1a7237db11",
  "team_blocked": false,
  "api_key_blocked": false,
  "api_key_disabled": false
}

Tokenize text

/v1/tokenize-text

Tokenize text with the specified model

Request Body

Response Body

token_idsarray<object>

A list of tokens.

Exampletext

text

{
  "text": "Hello world!",
  "model": "latest"
}
Exampletext

text

{
  "token_ids": [
    {
      "token_id": 13902,
      "string_token": "Hello",
      "token_bytes": [
        72,
        101,
        108,
        108,
        111
      ]
    },
    {
      "token_id": 1749,
      "string_token": " world",
      "token_bytes": [
        32,
        119,
        111,
        114,
        108,
        100
      ]
    },
    {
      "token_id": 161,
      "string_token": "!",
      "token_bytes": [
        33
      ]
    }
  ]
}

Last updated:September 14, 2026