OpenGateLLM (0.9.0)

Download OpenAPI specification:

License: MIT

OpenGateLLM connect to your models. You can configure this swagger UI in the configuration file, like hide routes or change the title.

Admin

Create Key

Create a new key for a user.

Authorizations:
HTTPBearer
Request Body schema: application/json
required
name
required
string (Name) non-empty

Name of the key.

user
required
integer (User)

User ID to create the token for another user (by default, the current user). Required CREATE_USER permission.

Expires (integer) or Expires (null) (Expires)

Expiration time, as Unix timestamp. If None, the key never expires.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "key-1",
  • "user": 0,
  • "expires": 0
}

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Get Keys

Authorizations:
HTTPBearer
query Parameters
User (integer) or User (null) (User)

The user ID to filter keys by.

offset
integer (Offset) >= 0
Default: 0

Number of keys to skip.

limit
integer (Limit) [ 1 .. 100 ]
Default: 10

Maximum number of keys to return.

sort_by
string (SortField)
Default: "id"
Enum: "id" "name" "created"

Field to sort by.

sort_order
string (SortOrder)
Default: "asc"
Enum: "asc" "desc"

Sort order.

KeyStatus (string) or Status (null) (Status)

Filter by key status. Omit to return all keys.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "total": 0,
  • "offset": 0,
  • "limit": 0,
  • "data": [
    ]
}

Get Key

Authorizations:
HTTPBearer
path Parameters
key_id
required
integer (Key Id)

The ID of the key to get.

Responses

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Delete Key

Revoke an API key. A revoked key can no longer be used.

Authorizations:
HTTPBearer
path Parameters
key_id
required
integer (Key Id)

The ID of the key to revoke.

Responses

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Create Organization

Authorizations:
HTTPBearer
Request Body schema: application/json
required
name
required
string (Name) non-empty

Name of the organization.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "my-org"
}

Response samples

Content type
application/json
{
  • "object": "organization",
  • "id": 0,
  • "name": "string",
  • "users": 0,
  • "created": 0,
  • "updated": 0
}

Get Organizations

Authorizations:
HTTPBearer
query Parameters
offset
integer (Offset) >= 0
Default: 0

Number of organizations to skip.

limit
integer (Limit) [ 1 .. 100 ]
Default: 10

Maximum number of organizations to return.

sort_by
string (OrganizationSortField)
Default: "id"
Enum: "id" "name" "created" "updated"

Field to sort by.

sort_order
string (SortOrder)
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "total": 0,
  • "offset": 0,
  • "limit": 0,
  • "data": [
    ]
}

Get Organization

Authorizations:
HTTPBearer
path Parameters
organization_id
required
integer (Organization Id)

The ID of the organization to get.

Responses

Response samples

Content type
application/json
{
  • "object": "organization",
  • "id": 0,
  • "name": "string",
  • "users": 0,
  • "created": 0,
  • "updated": 0
}

Delete Organization

Authorizations:
HTTPBearer
path Parameters
organization_id
required
integer (Organization Id)

The ID of the organization to delete.

Responses

Response samples

Content type
application/json
{
  • "object": "organization",
  • "id": 0,
  • "name": "string",
  • "users": 0,
  • "created": 0,
  • "updated": 0
}

Update Organization

Authorizations:
HTTPBearer
path Parameters
organization_id
required
integer (Organization Id)

The ID of the organization to update.

Request Body schema: application/json
required
name
required
string (Name) non-empty

Name of the organization.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "my-org"
}

Response samples

Content type
application/json
{
  • "object": "organization",
  • "id": 0,
  • "name": "string",
  • "users": 0,
  • "created": 0,
  • "updated": 0
}

Create Provider

Authorizations:
HTTPBearer
Request Body schema: application/json
required
type
required
string (ProviderType)
Enum: "albert" "openai" "mistral" "tei" "vllm"

Model provider type.

Url (string) or Url (null) (Url)

Model provider API url. The url must only contain the domain name (without /v1 suffix for example). Depends of the model provider type, the url can be optional (Albert, OpenAI).

Key (string) or Key (null) (Key)

Model provider API key.

BasicAuth (object) or null

Model provider basic authentication.

timeout
integer (Timeout)
Default: 300

Timeout for the model provider requests, after user receive an 503 error (model is too busy).

model_name
required
string (Model Name)

Model name from the model provider.

model_hosting_zone
string (HostingZone)
Default: "WOR"
Enum: "ABW" "AFG" "AGO" "AIA" "ALA" "ALB" "AND" "ARE" "ARG" "ARM" "ASM" "ATA" "ATF" "ATG" "AUS" "AUT" "AZE" "BDI" "BEL" "BEN" "BES" "BFA" "BGD" "BGR" "BHR" "BHS" "BIH" "BLM" "BLR" "BLZ" "BMU" "BOL" "BRA" "BRB" "BRN" "BTN" "BVT" "BWA" "CAF" "CAN" "CCK" "CHE" "CHL" "CHN" "CIV" "CMR" "COD" "COG" "COK" "COL" "COM" "CPV" "CRI" "CUB" "CUW" "CXR" "CYM" "CYP" "CZE" "DEU" "DJI" "DMA" "DNK" "DOM" "DZA" "ECU" "EGY" "ERI" "ESH" "ESP" "EST" "ETH" "FIN" "FJI" "FLK" "FRA" "FRO" "FSM" "GAB" "GBR" "GEO" "GGY" "GHA" "GIB" "GIN" "GLP" "GMB" "GNB" "GNQ" "GRC" "GRD" "GRL" "GTM" "GUF" "GUM" "GUY" "HKG" "HMD" "HND" "HRV" "HTI" "HUN" "IDN" "IMN" "IND" "IOT" "IRL" "IRN" "IRQ" "ISL" "ISR" "ITA" "JAM" "JEY" "JOR" "JPN" "KAZ" "KEN" "KGZ" "KHM" "KIR" "KNA" "KOR" "KWT" "LAO" "LBN" "LBR" "LBY" "LCA" "LIE" "LKA" "LSO" "LTU" "LUX" "LVA" "MAC" "MAF" "MAR" "MCO" "MDA" "MDG" "MDV" "MEX" "MHL" "MKD" "MLI" "MLT" "MMR" "MNE" "MNG" "MNP" "MOZ" "MRT" "MSR" "MTQ" "MUS" "MWI" "MYS" "MYT" "NAM" "NCL" "NER" "NFK" "NGA" "NIC" "NIU" "NLD" "NOR" "NPL" "NRU" "NZL" "OMN" "PAK" "PAN" "PCN" "PER" "PHL" "PLW" "PNG" "POL" "PRI" "PRK" "PRT" "PRY" "PSE" "PYF" "QAT" "REU" "ROU" "RUS" "RWA" "SAU" "SDN" "SEN" "SGP" "SGS" "SHN" "SJM" "SLB" "SLE" "SLV" "SMR" "SOM" "SPM" "SRB" "SSD" "STP" "SUR" "SVK" "SVN" "SWE" "SWZ" "SXM" "SYC" "SYR" "TCA" "TCD" "TGO" "THA" "TJK" "TKL" "TKM" "TLS" "TON" "TTO" "TUN" "TUR" "TUV" "TWN" "TZA" "UGA" "UKR" "UMI" "URY" "USA" "UZB" "VAT" "VCT" "VEN" "VGB" "VIR" "VNM" "VUT" "WLF" "WOR" "WSM" "YEM" "ZAF" "ZMB" "ZWE"

Model hosting zone using ISO 3166-1 alpha-3 code format (e.g., WOR for World, FRA for France, USA for United States). This determines the electricity mix used for carbon intensity calculations. For more information, see https://ecologits.ai

model_total_params
integer (Model Total Params) >= 0
Default: 0

Total params of the model in billions of parameters for carbon footprint computation. For more information, see https://ecologits.ai

model_active_params
integer (Model Active Params) >= 0
Default: 0

Active params of the model in billions of parameters for carbon footprint computation. For more information, see https://ecologits.ai

router_id
required
integer (Router Id)

ID of the model to create the provider for (router ID, eg. 123).

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "type": "albert",
  • "url": "string",
  • "key": "string",
  • "basic_auth": {
    },
  • "timeout": 300,
  • "model_name": "string",
  • "model_hosting_zone": "ABW",
  • "model_total_params": 0,
  • "model_active_params": 0,
  • "router_id": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "router_id": 0,
  • "user_id": 0,
  • "type": "albert",
  • "url": "string",
  • "key": "string",
  • "basic_auth": {
    },
  • "timeout": 1,
  • "model_name": "string",
  • "model_hosting_zone": "ABW",
  • "model_total_params": 0,
  • "model_active_params": 0,
  • "created": 0,
  • "updated": 0
}

Get Providers

Authorizations:
HTTPBearer
query Parameters
Router Id (integer) or Router Id (null) (Router Id)

Filter providers by router ID.

offset
integer (Offset) >= 0
Default: 0

Number of providers to skip.

limit
integer (Limit) [ 1 .. 100 ]
Default: 10

Maximum number of providers to return.

sort_by
string (ProviderSortField)
Default: "id"
Enum: "id" "model_name" "created"

Field to sort by.

sort_order
string (SortOrder)
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "total": 0,
  • "offset": 0,
  • "limit": 0,
  • "data": [
    ]
}

Delete Provider

Authorizations:
HTTPBearer
path Parameters
provider_id
required
integer (Provider Id)

The ID of the provider to delete.

Responses

Response samples

Content type
application/json
{
  • "object": "provider",
  • "id": 0,
  • "router_id": 0,
  • "user_id": 0,
  • "type": "albert",
  • "url": "string",
  • "timeout": 0,
  • "model_name": "string",
  • "model_hosting_zone": "ABW",
  • "model_total_params": 0,
  • "model_active_params": 0,
  • "max_context_length": 0,
  • "vector_size": 0,
  • "created": 0,
  • "updated": 0
}

Update Provider

Authorizations:
HTTPBearer
path Parameters
provider_id
required
integer (Provider Id)

The ID of the provider to update.

Request Body schema: application/json
required
router_id
required
integer (Router Id)

The ID of the router to assign to the provider.

timeout
required
integer (Timeout) [ 1 .. 3600 ]

Timeout for the model provider requests, after user receive an 500 error (model is too busy).

model_hosting_zone
required
string (HostingZone)
Enum: "ABW" "AFG" "AGO" "AIA" "ALA" "ALB" "AND" "ARE" "ARG" "ARM" "ASM" "ATA" "ATF" "ATG" "AUS" "AUT" "AZE" "BDI" "BEL" "BEN" "BES" "BFA" "BGD" "BGR" "BHR" "BHS" "BIH" "BLM" "BLR" "BLZ" "BMU" "BOL" "BRA" "BRB" "BRN" "BTN" "BVT" "BWA" "CAF" "CAN" "CCK" "CHE" "CHL" "CHN" "CIV" "CMR" "COD" "COG" "COK" "COL" "COM" "CPV" "CRI" "CUB" "CUW" "CXR" "CYM" "CYP" "CZE" "DEU" "DJI" "DMA" "DNK" "DOM" "DZA" "ECU" "EGY" "ERI" "ESH" "ESP" "EST" "ETH" "FIN" "FJI" "FLK" "FRA" "FRO" "FSM" "GAB" "GBR" "GEO" "GGY" "GHA" "GIB" "GIN" "GLP" "GMB" "GNB" "GNQ" "GRC" "GRD" "GRL" "GTM" "GUF" "GUM" "GUY" "HKG" "HMD" "HND" "HRV" "HTI" "HUN" "IDN" "IMN" "IND" "IOT" "IRL" "IRN" "IRQ" "ISL" "ISR" "ITA" "JAM" "JEY" "JOR" "JPN" "KAZ" "KEN" "KGZ" "KHM" "KIR" "KNA" "KOR" "KWT" "LAO" "LBN" "LBR" "LBY" "LCA" "LIE" "LKA" "LSO" "LTU" "LUX" "LVA" "MAC" "MAF" "MAR" "MCO" "MDA" "MDG" "MDV" "MEX" "MHL" "MKD" "MLI" "MLT" "MMR" "MNE" "MNG" "MNP" "MOZ" "MRT" "MSR" "MTQ" "MUS" "MWI" "MYS" "MYT" "NAM" "NCL" "NER" "NFK" "NGA" "NIC" "NIU" "NLD" "NOR" "NPL" "NRU" "NZL" "OMN" "PAK" "PAN" "PCN" "PER" "PHL" "PLW" "PNG" "POL" "PRI" "PRK" "PRT" "PRY" "PSE" "PYF" "QAT" "REU" "ROU" "RUS" "RWA" "SAU" "SDN" "SEN" "SGP" "SGS" "SHN" "SJM" "SLB" "SLE" "SLV" "SMR" "SOM" "SPM" "SRB" "SSD" "STP" "SUR" "SVK" "SVN" "SWE" "SWZ" "SXM" "SYC" "SYR" "TCA" "TCD" "TGO" "THA" "TJK" "TKL" "TKM" "TLS" "TON" "TTO" "TUN" "TUR" "TUV" "TWN" "TZA" "UGA" "UKR" "UMI" "URY" "USA" "UZB" "VAT" "VCT" "VEN" "VGB" "VIR" "VNM" "VUT" "WLF" "WOR" "WSM" "YEM" "ZAF" "ZMB" "ZWE"

Model hosting zone using ISO 3166-1 alpha-3 code format (e.g., WOR for World, FRA for France, USA for United States). This determines the electricity mix used for carbon intensity calculations. For more information, see https://ecologits.ai

model_total_params
required
integer (Model Total Params) >= 0

Total params of the model in billions of parameters for carbon footprint computation. If 0, the active params will be used if provided, else carbon footprint will not be computed. For more information, see https://ecologits.ai

model_active_params
required
integer (Model Active Params) >= 0

Active params of the model in billions of parameters for carbon footprint computation. If 0, the total params will be used if provided, else carbon footprint will not be computed. For more information, see https://ecologits.ai

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "router_id": 0,
  • "timeout": 1,
  • "model_hosting_zone": "ABW",
  • "model_total_params": 0,
  • "model_active_params": 0
}

Response samples

Content type
application/json
{
  • "object": "provider",
  • "id": 0,
  • "router_id": 0,
  • "user_id": 0,
  • "type": "albert",
  • "url": "string",
  • "timeout": 0,
  • "model_name": "string",
  • "model_hosting_zone": "ABW",
  • "model_total_params": 0,
  • "model_active_params": 0,
  • "max_context_length": 0,
  • "vector_size": 0,
  • "created": 0,
  • "updated": 0
}

Get Provider

Authorizations:
HTTPBearer
path Parameters
provider_id
required
integer (Provider Id)

The ID of the provider to get.

Responses

Response samples

Content type
application/json
{
  • "object": "provider",
  • "id": 0,
  • "router_id": 0,
  • "user_id": 0,
  • "type": "albert",
  • "url": "string",
  • "timeout": 0,
  • "model_name": "string",
  • "model_hosting_zone": "ABW",
  • "model_total_params": 0,
  • "model_active_params": 0,
  • "max_context_length": 0,
  • "vector_size": 0,
  • "created": 0,
  • "updated": 0
}

Create Role

Authorizations:
HTTPBearer
Request Body schema: application/json
required
Name (string) or Name (null) (Name)

Name of the role.

Array of Permissions (strings) or Permissions (null) (Permissions)

List of permissions.

Array of Limits (objects) or Limits (null) (Limits)

List of limits.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "my-role",
  • "permissions": [
    ],
  • "limits": [
    ]
}

Response samples

Content type
application/json
{
  • "object": "role",
  • "id": 0,
  • "name": "string",
  • "permissions": [
    ],
  • "limits": [
    ],
  • "users": 0,
  • "created": 0,
  • "updated": 0
}

Get Roles

Authorizations:
HTTPBearer
query Parameters
offset
integer (Offset) >= 0
Default: 0

Number of roles to skip.

limit
integer (Limit) [ 1 .. 100 ]
Default: 10

Maximum number of roles to return.

sort_by
string (SortField)
Default: "id"
Enum: "id" "name" "created"

Field to sort by.

sort_order
string (SortOrder)
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "total": 0,
  • "offset": 0,
  • "limit": 0,
  • "data": [
    ]
}

Update Role

Authorizations:
HTTPBearer
path Parameters
role_id
required
integer (Role Id)

The ID of the role to update.

Request Body schema: application/json
required
name
required
string (Name) non-empty

Name of the role.

permissions
required
Array of strings (Permissions)
Items Enum: "admin" "read_metric" "provide_models"

List of permissions replacing the current ones. An empty list removes all the permissions.

required
Array of objects (Limits)

List of limits replacing the current ones. An empty list removes all the limits.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "my-role",
  • "permissions": [
    ],
  • "limits": [
    ]
}

Response samples

Content type
application/json
{
  • "object": "role",
  • "id": 0,
  • "name": "string",
  • "permissions": [
    ],
  • "limits": [
    ],
  • "users": 0,
  • "created": 0,
  • "updated": 0
}

Get Role

Authorizations:
HTTPBearer
path Parameters
role_id
required
integer (Role Id)

The ID of the role to get.

Responses

Response samples

Content type
application/json
{
  • "object": "role",
  • "id": 0,
  • "name": "string",
  • "permissions": [
    ],
  • "limits": [
    ],
  • "users": 0,
  • "created": 0,
  • "updated": 0
}

Delete Role

Authorizations:
HTTPBearer
path Parameters
role_id
required
integer (Role Id)

The ID of the role to delete.

Responses

Response samples

Content type
application/json
{
  • "object": "role",
  • "id": 0,
  • "name": "string",
  • "permissions": [
    ],
  • "limits": [
    ],
  • "users": 0,
  • "created": 0,
  • "updated": 0
}

Create Router

Authorizations:
HTTPBearer
Request Body schema: application/json
required
name
required
string (Name) non-empty

Name of the model router.

type
required
string (RouterType)
Enum: "automatic-speech-recognition" "image-to-text" "text-classification" "text-embeddings-inference" "text-generation"

Type of the model router. It will be used to identify the model router type.

aliases
Array of strings (Aliases) [ items [ 1 .. 64 ] characters ]

Aliases of the model. It will be used to identify the model by users.

load_balancing_strategy
string (RouterLoadBalancingStrategy)
Default: "shuffle"
Enum: "shuffle" "least_busy"

Routing strategy for load balancing between providers of the model. It will be used to identify the model type.

cost_prompt_tokens
number (Cost Prompt Tokens) >= 0
Default: 0

Cost of a million prompt tokens (decrease user budget)

cost_completion_tokens
number (Cost Completion Tokens) >= 0
Default: 0

Cost of a million completion tokens (decrease user budget)

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "model-router-1",
  • "type": "automatic-speech-recognition",
  • "aliases": [
    ],
  • "load_balancing_strategy": "shuffle",
  • "cost_prompt_tokens": 0,
  • "cost_completion_tokens": 0
}

Response samples

Content type
application/json
{
  • "object": "router",
  • "id": 0,
  • "name": "string",
  • "user_id": 0,
  • "type": "automatic-speech-recognition",
  • "aliases": [
    ],
  • "load_balancing_strategy": "shuffle",
  • "cost_prompt_tokens": 0,
  • "cost_completion_tokens": 0,
  • "providers": 0,
  • "created": 0,
  • "updated": 0
}

Get Routers

Authorizations:
HTTPBearer
query Parameters
offset
integer (Offset) >= 0
Default: 0

Number of routers to skip.

limit
integer (Limit) [ 1 .. 100 ]
Default: 10

Maximum number of routers to return.

sort_by
string (SortField)
Default: "id"
Enum: "id" "name" "created"

Field to sort by.

sort_order
string (SortOrder)
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "total": 0,
  • "offset": 0,
  • "limit": 0,
  • "data": [
    ]
}

Get Router

Authorizations:
HTTPBearer
path Parameters
router_id
required
integer (Router Id)

The router ID.

Responses

Response samples

Content type
application/json
{
  • "object": "router",
  • "id": 0,
  • "name": "string",
  • "user_id": 0,
  • "type": "automatic-speech-recognition",
  • "aliases": [
    ],
  • "load_balancing_strategy": "shuffle",
  • "cost_prompt_tokens": 0,
  • "cost_completion_tokens": 0,
  • "providers": 0,
  • "created": 0,
  • "updated": 0
}

Delete Router

Authorizations:
HTTPBearer
path Parameters
router_id
required
integer (Router Id)

The ID of the router to delete (router ID, eg. 123).

Responses

Response samples

Content type
application/json
{
  • "object": "router",
  • "id": 0,
  • "name": "string",
  • "user_id": 0,
  • "type": "automatic-speech-recognition",
  • "aliases": [
    ],
  • "load_balancing_strategy": "shuffle",
  • "cost_prompt_tokens": 0,
  • "cost_completion_tokens": 0,
  • "providers": 0,
  • "created": 0,
  • "updated": 0
}

Update Router

Authorizations:
HTTPBearer
path Parameters
router_id
required
integer (Router Id)

The ID of the router to update (router ID, eg. 123).

Request Body schema: application/json
required
name
required
string (Name) non-empty

Name of the model router.

type
required
string (RouterType)
Enum: "automatic-speech-recognition" "image-to-text" "text-classification" "text-embeddings-inference" "text-generation"

Type of the model router. It will be used to identify the model router type.

aliases
required
Array of strings (Aliases) [ items [ 1 .. 64 ] characters ]

Aliases of the model replacing the current ones. It will be used to identify the model by users. An empty list removes all the aliases.

load_balancing_strategy
required
string (RouterLoadBalancingStrategy)
Enum: "shuffle" "least_busy"

Routing strategy for load balancing between providers of the model. It will be used to identify the model type.

cost_prompt_tokens
required
number (Cost Prompt Tokens) >= 0

Cost of a million prompt tokens (decrease user budget)

cost_completion_tokens
required
number (Cost Completion Tokens) >= 0

Cost of a million completion tokens (decrease user budget)

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "model-router-1",
  • "type": "automatic-speech-recognition",
  • "aliases": [
    ],
  • "load_balancing_strategy": "shuffle",
  • "cost_prompt_tokens": 0,
  • "cost_completion_tokens": 0
}

Response samples

Content type
application/json
{
  • "object": "router",
  • "id": 0,
  • "name": "string",
  • "user_id": 0,
  • "type": "automatic-speech-recognition",
  • "aliases": [
    ],
  • "load_balancing_strategy": "shuffle",
  • "cost_prompt_tokens": 0,
  • "cost_completion_tokens": 0,
  • "providers": 0,
  • "created": 0,
  • "updated": 0
}

Create User

Authorizations:
HTTPBearer
Request Body schema: application/json
required
email
required
string (Email) [ 1 .. 254 ] characters

The user email.

Name (string) or Name (null) (Name)

The user name.

password
required
string (Password) [ 6 .. 72 ] characters

The user password.

role_id
required
integer (Role Id)

The role ID.

organization_id
required
integer (Organization Id)

The organization ID.

Budget (number) or Budget (null) (Budget)

The budget.

Expires (integer) or Expires (null) (Expires)

The expiration timestamp.

priority
integer (Priority) >= 0
Default: 0

The user priority. Higher value means higher priority.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "name": "string",
  • "password": "string",
  • "role_id": 0,
  • "organization_id": 0,
  • "budget": 0,
  • "expires": 0,
  • "priority": 0
}

Response samples

Content type
application/json
{
  • "object": "user",
  • "id": 0,
  • "email": "string",
  • "name": "string",
  • "sub": "string",
  • "iss": "string",
  • "role_id": 0,
  • "organization_id": 0,
  • "budget": 0,
  • "expires": 0,
  • "created": 0,
  • "updated": 0,
  • "priority": 0
}

Get Users

Authorizations:
HTTPBearer
query Parameters
Role Id (integer) or Role Id (null) (Role Id)

The ID of the role to filter the users by.

Organization Id (integer) or Organization Id (null) (Organization Id)

The ID of the organization to filter the users by.

Email (string) or Email (null) (Email)

Email substring to filter the users by.

offset
integer (Offset) >= 0
Default: 0

Number of users to skip.

limit
integer (Limit) [ 1 .. 100 ]
Default: 10

Maximum number of users to return.

sort_by
string (UserSortField)
Default: "id"
Enum: "id" "email" "created" "updated"

Field to sort by.

sort_order
string (SortOrder)
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "total": 0,
  • "offset": 0,
  • "limit": 0,
  • "data": [
    ]
}

Get User

Authorizations:
HTTPBearer
path Parameters
user_id
required
integer (User Id)

The ID of the user to get.

Responses

Response samples

Content type
application/json
{
  • "object": "user",
  • "id": 0,
  • "email": "string",
  • "name": "string",
  • "sub": "string",
  • "iss": "string",
  • "role_id": 0,
  • "organization_id": 0,
  • "budget": 0,
  • "expires": 0,
  • "created": 0,
  • "updated": 0,
  • "priority": 0
}

Delete User

Authorizations:
HTTPBearer
path Parameters
user_id
required
integer (User Id)

The ID of the user to delete.

Responses

Response samples

Content type
application/json
{
  • "object": "user",
  • "id": 0,
  • "email": "string",
  • "name": "string",
  • "sub": "string",
  • "iss": "string",
  • "role_id": 0,
  • "organization_id": 0,
  • "budget": 0,
  • "expires": 0,
  • "created": 0,
  • "updated": 0,
  • "priority": 0
}

Update User

Authorizations:
HTTPBearer
path Parameters
user_id
required
integer (User Id)

The ID of the user to update.

Request Body schema: application/json
required
email
required
string (Email) [ 1 .. 254 ] characters

The new user email.

required
Name (string) or Name (null) (Name)

The new user name. If null, the user name is removed.

Current Password (string) or Current Password (null) (Current Password)

The current user password. Only required to change the password.

Password (string) or Password (null) (Password)

The new user password. If omitted, the user password is not changed.

role_id
required
integer (Role Id)

The new role ID.

organization_id
required
integer (Organization Id)

The new organization ID.

required
Budget (number) or Budget (null) (Budget)

The new budget. If null, the user will have no budget.

required
Expires (integer) or Expires (null) (Expires)

The new expiration timestamp. If null, the user will never expire.

priority
required
integer (Priority) >= 0

The new user priority. Higher value means higher priority.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "name": "string",
  • "current_password": "string",
  • "password": "string",
  • "role_id": 0,
  • "organization_id": 0,
  • "budget": 0,
  • "expires": 0,
  • "priority": 0
}

Response samples

Content type
application/json
{
  • "object": "user",
  • "id": 0,
  • "email": "string",
  • "name": "string",
  • "sub": "string",
  • "iss": "string",
  • "role_id": 0,
  • "organization_id": 0,
  • "budget": 0,
  • "expires": 0,
  • "created": 0,
  • "updated": 0,
  • "priority": 0
}

Audio

Create Audio Transcription

Authorizations:
HTTPBearer
Request Body schema: multipart/form-data
required
file
required
string <application/octet-stream> (File)

The audio file object (not file name) to transcribe, in one of these formats: mp3 or wav.

model
required
string (Model)

ID of the model to use. Call /v1/models endpoint to get the list of available models, only automatic-speech-recognition model type is supported.

AudioTranscriptionLanguage (string) or null

The language of the output audio. If the output language is different than the audio language, the audio language will be translated into the output language. Output language must be supplied in ISO-639-1 format (e.g. en, fr) format.

prompt
string (Prompt)
Default: ""

An optional text to tell the model what to do with the input audio.

response_format
string (AudioTranscriptionsResponseFormat)
Default: "json"
Enum: "json" "text" "diarized_json" "srt" "verbose_json" "vtt"

The format of the transcript output: json (default), text, diarized_json to return per-segment speaker labels, srt or vtt for subtitle formats.

temperature
number (Temperature) [ 0 .. 1 ]
Default: 0

The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "text": "string",
  • "model": "string",
  • "segments": [
    ],
  • "usage": {
    }
}

Auth

Login

Request Body schema: application/json
required
email
required
string (Email) [ 1 .. 254 ] characters

The user email.

password
required
string (Password) [ 1 .. 72 ] characters

The user password.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Sso Login

Request Body schema: application/json
required
sub
required
string (Sub) non-empty

Subject identifier from the OIDC id_token.

iss
required
string (Iss) non-empty

Issuer identifier from the OIDC id_token.

exp
required
integer (Exp)

Expiration timestamp (seconds since epoch) from the OIDC id_token.

object (Claims)

OIDC claims from the identity provider access token /userinfo endpoint.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "sub": "string",
  • "iss": "string",
  • "exp": 0,
  • "claims": { }
}

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Chat

Create Chat Completions

Creates a model response for the given chat conversation.

Authorizations:
HTTPBearer
Request Body schema: application/json
required
required
Array of objects (Messages)

A list of messages comprising the conversation so far.

model
required
string (Model) non-empty

ID of the model to use. Call /v1/models endpoint to get the list of available models, only text-generation model type is supported.

Stream (boolean) or Stream (null) (Stream)
Default: false

If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "messages": [
    ],
  • "model": "string",
  • "stream": false
}

Response samples

Content type
application/json
Example
{
  • "id": "string",
  • "choices": [
    ],
  • "created": 0,
  • "model": "string",
  • "object": "chat.completion",
  • "service_tier": "auto",
  • "system_fingerprint": "string",
  • "usage": {
    }
}

Embeddings

Create Embeddings

Authorizations:
HTTPBearer
Request Body schema: application/json
required
model
required
string (Model) non-empty

ID of the model to use. Call /v1/models endpoint to get the list of available models, only text-embeddings-inference model type is supported.

(Input (Array of Input (integers) or Array of Input (integers) or Input (string) or Array of Input (strings))) or Input (null) (Input)

Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (call /v1/models endpoint to get the max_context_length by model) and cannot be an empty string.

encoding_format
string (EncodingFormat)
Default: "float"
Enum: "float" "base64"

The format of the output embeddings.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "model": "string",
  • "input": [
    ],
  • "encoding_format": "float"
}

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "model": "string",
  • "object": "list",
  • "usage": {
    },
  • "id": "string"
}

Health

Get Health

Get the health of the API.

Responses

Response samples

Content type
application/json
null

Get Health Models

Get the health of the models.

Authorizations:
HTTPBearer

Responses

Response samples

Content type
application/json
null

Keys

Create Key

Create a new API key for the authenticated user.

Authorizations:
HTTPBearer
Request Body schema: application/json
required
name
required
string (Name) non-empty

Name of the key.

Expires (integer) or Expires (null) (Expires)

Expiration time, as Unix timestamp. If None, uses the configured maximum key lifetime when set, otherwise the key never expires.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "key-1",
  • "expires": 0
}

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Get Keys

Get all your keys.

Omit status to list every key. Use active, expired, or revoked to filter.

Authorizations:
HTTPBearer
query Parameters
offset
integer (Offset) >= 0
Default: 0

Number of keys to skip.

limit
integer (Limit) [ 1 .. 100 ]
Default: 10

Maximum number of keys to return.

sort_by
string (SortField)
Default: "id"
Enum: "id" "name" "created"

Field to sort by.

sort_order
string (SortOrder)
Default: "asc"
Enum: "asc" "desc"

Sort order.

KeyStatus (string) or Status (null) (Status)

Filter by key status. Omit to return all keys.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "total": 0,
  • "offset": 0,
  • "limit": 0,
  • "data": [
    ]
}

Create Key Deprecated

Create a new API key for the authenticated user.

Authorizations:
HTTPBearer
Request Body schema: application/json
required
name
required
string (Name) non-empty

Name of the key.

Expires (integer) or Expires (null) (Expires)

Expiration time, as Unix timestamp. If None, uses the configured maximum key lifetime when set, otherwise the key never expires.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "key-1",
  • "expires": 0
}

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Get Keys Deprecated

Get all your keys.

Omit status to list every key. Use active, expired, or revoked to filter.

Authorizations:
HTTPBearer
query Parameters
offset
integer (Offset) >= 0
Default: 0

Number of keys to skip.

limit
integer (Limit) [ 1 .. 100 ]
Default: 10

Maximum number of keys to return.

sort_by
string (SortField)
Default: "id"
Enum: "id" "name" "created"

Field to sort by.

sort_order
string (SortOrder)
Default: "asc"
Enum: "asc" "desc"

Sort order.

KeyStatus (string) or Status (null) (Status)

Filter by key status. Omit to return all keys.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "total": 0,
  • "offset": 0,
  • "limit": 0,
  • "data": [
    ]
}

Get Key

Get one of your API keys by ID.

Authorizations:
HTTPBearer
path Parameters
key_id
required
integer (Key Id)

The ID of the key to get.

Responses

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Update Key

Update an API key name.

Authorizations:
HTTPBearer
path Parameters
key_id
required
integer (Key Id)

The ID of the key to update.

Request Body schema: application/json
required
name
required
string (Name) non-empty

Name of the key.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "key-1"
}

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Delete Key

Revoke an API key. A revoked key can no longer be used.

Authorizations:
HTTPBearer
path Parameters
key_id
required
integer (Key Id)

The ID of the key to revoke.

Responses

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Get Key Deprecated

Get one of your API keys by ID.

Authorizations:
HTTPBearer
path Parameters
key_id
required
integer (Key Id)

The ID of the key to get.

Responses

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Update Key Deprecated

Update an API key name.

Authorizations:
HTTPBearer
path Parameters
key_id
required
integer (Key Id)

The ID of the key to update.

Request Body schema: application/json
required
name
required
string (Name) non-empty

Name of the key.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "key-1"
}

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Delete Key Deprecated

Revoke an API key. A revoked key can no longer be used.

Authorizations:
HTTPBearer
path Parameters
key_id
required
integer (Key Id)

The ID of the key to revoke.

Responses

Response samples

Content type
application/json
{
  • "object": "key",
  • "id": 0,
  • "name": "string",
  • "value": "string",
  • "user_id": 0,
  • "expires": 0,
  • "created": 0,
  • "revoked": true
}

Me

Get Me

Get my user information.

Authorizations:
HTTPBearer

Responses

Response samples

Content type
application/json
{
  • "object": "userInfo",
  • "id": 0,
  • "email": "string",
  • "name": "string",
  • "organization_id": 0,
  • "budget": 0,
  • "permissions": [
    ],
  • "limits": [
    ],
  • "expires": 0
}

Update Me

Update information about the current user.

Authorizations:
HTTPBearer
Request Body schema: application/json
required
name
required
string (Name) non-empty

The user name.

email
required
string (Email) [ 1 .. 254 ] characters

The user email.

Current Password (string) or Current Password (null) (Current Password)

The current user password. If None, the password is not changed and password is ignored.

Password (string) or Password (null) (Password)

The new user password. Required when current_password is provided. Ignored when current_password is None.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "string",
  • "current_password": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "status_code": 0,
  • "detail": "string",
  • "headers": {
    }
}

Get Me Deprecated

Get my user information.

Authorizations:
HTTPBearer

Responses

Response samples

Content type
application/json
{
  • "object": "userInfo",
  • "id": 0,
  • "email": "string",
  • "name": "string",
  • "organization_id": 0,
  • "budget": 0,
  • "permissions": [
    ],
  • "limits": [
    ],
  • "expires": 0
}

Update Me Deprecated

Update information about the current user.

Authorizations:
HTTPBearer
Request Body schema: application/json
required
name
required
string (Name) non-empty

The user name.

email
required
string (Email) [ 1 .. 254 ] characters

The user email.

Current Password (string) or Current Password (null) (Current Password)

The current user password. If None, the password is not changed and password is ignored.

Password (string) or Password (null) (Password)

The new user password. Required when current_password is provided. Ignored when current_password is None.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "string",
  • "current_password": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "status_code": 0,
  • "detail": "string",
  • "headers": {
    }
}

Models

Get Models

Lists the currently available models and provides basic information.

Authorizations:
HTTPBearer

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "data": [
    ]
}

Get Model

Get a model by name and provide basic information.

Authorizations:
HTTPBearer
path Parameters
model
required
string (Model)

The name of the model to get.

Responses

Response samples

Content type
application/json
{
  • "object": "model",
  • "id": "string",
  • "type": "automatic-speech-recognition",
  • "aliases": [
    ],
  • "created": 0,
  • "owned_by": "string",
  • "max_context_length": 0,
  • "costs": {
    }
}

OCR

Create Ocr

Extracts text from files using Mistral Document AI pipeline

Authorizations:
HTTPBearer
Request Body schema: application/json
required
required
DocumentURLChunk (object) or ImageURLChunk (object) (Document)

Document to run OCR on.

Document Annotation Prompt (string) or Document Annotation Prompt (null) (Document Annotation Prompt)

Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided.

model
required
string (Model)

The model to use for the OCR, call /v1/models endpoint to get the list of available models, only image-to-text model type is supported.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "document": {
    },
  • "document_annotation_prompt": "string",
  • "model": "string"
}

Response samples

Content type
application/json
{
  • "document_annotation": "string",
  • "id": "string",
  • "model": "string",
  • "pages": [
    ],
  • "usage": {
    },
  • "usage_info": {
    }
}

Organizations

Get My Organization

Get the organization of the authenticated user.

Authorizations:
HTTPBearer

Responses

Response samples

Content type
application/json
{
  • "object": "organization",
  • "id": 0,
  • "name": "string",
  • "users": 0,
  • "created": 0,
  • "updated": 0
}

Rerank

Create Rerank

Authorizations:
HTTPBearer
Request Body schema: application/json
required
query
required
string (Query) non-empty

The search query to use for the reranking. query and prompt cannot both be provided.

documents
required
Array of strings (Documents) [ items non-empty ]
model
required
string (Model) non-empty

The model to use for the reranking, call /v1/models endpoint to get the list of available models, only text-classification model type is supported.

Top N (integer) or Top N (null) (Top N)

The number of top results to return. If set to None, all results will be returned.

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "query": "string",
  • "documents": [
    ],
  • "model": "string",
  • "top_n": 1
}

Response samples

Content type
application/json
{
  • "object": "list",
  • "id": "string",
  • "results": [
    ],
  • "model": "string",
  • "usage": {
    }
}

Usage

Get Usages

Get daily usage buckets for the current user.

Authorizations:
HTTPBearer
query Parameters
offset
integer (Offset) >= 0
Default: 0

Number of usage buckets to skip.

limit
integer (Limit) [ 1 .. 100 ]
Default: 10

Maximum number of usage buckets to return.

start_time
required
integer (Start Time)

Start time as Unix timestamp.

end_time
required
integer (End Time)

End time as Unix timestamp.

EndpointUsage (string) or Endpoint (null) (Endpoint)

The endpoint to get usage for.

Model (string) or Model (null) (Model)

Router name to filter usage by.

Key Id (integer) or Key Id (null) (Key Id)

Key ID to filter usage by.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "total": 0,
  • "offset": 0,
  • "limit": 0,
  • "data": [
    ]
}

Get Usages Deprecated

Get daily usage buckets for the current user.

Authorizations:
HTTPBearer
query Parameters
offset
integer (Offset) >= 0
Default: 0

Number of usage buckets to skip.

limit
integer (Limit) [ 1 .. 100 ]
Default: 10

Maximum number of usage buckets to return.

start_time
required
integer (Start Time)

Start time as Unix timestamp.

end_time
required
integer (End Time)

End time as Unix timestamp.

EndpointUsage (string) or Endpoint (null) (Endpoint)

The endpoint to get usage for.

Model (string) or Model (null) (Model)

Router name to filter usage by.

Key Id (integer) or Key Id (null) (Key Id)

Key ID to filter usage by.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "total": 0,
  • "offset": 0,
  • "limit": 0,
  • "data": [
    ]
}

Monitoring

Get Metrics

Authorizations:
HTTPBearer

Responses

Response samples

Content type
application/json
null