Skip to main content

Management API: LLM Provider Management

You're reading API Gateway 1.0.0. The newest release is 1.2.0. Go to the newest release

CRUD operations for LLM Provider configurations

Create a new LLM provider​

POST /llm-providers

Code samples


curl -X POST http://localhost:9090/api/management/v0.9/llm-providers \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Add a new LLM provider to the Gateway. A provider defines how to interact with an LLM service, including upstream endpoints, authentication, access control, and policies.

Payload

{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "LlmProvider",
"metadata": {
"name": "wso2-openai-provider"
},
"spec": {
"displayName": "OpenAI Provider",
"version": "v1.0",
"template": "openai",
"context": "/openai/latest",
"upstream": {
"url": "https://api.openai.com/v1",
"auth": {
"type": "api-key",
"header": "Authorization",
"value": "Bearer sk-your-api-key"
}
},
"accessControl": {
"mode": "deny_all",
"exceptions": [
{
"path": "/chat/completions",
"methods": [
"POST"
]
},
{
"path": "/models",
"methods": [
"GET"
]
},
{
"path": "/models/{modelId}",
"methods": [
"GET"
]
}
]
}
}
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`

Parameters​

NameInTypeRequiredDescription
bodybodyLLMProviderConfigurationRequesttrueLLM provider in YAML or JSON format

Example responses

201 Response

{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "LlmProvider",
"metadata": {
"name": "wso2-openai-provider"
},
"spec": {
"displayName": "OpenAI Provider",
"version": "v1.0",
"template": "openai",
"context": "/openai/latest",
"upstream": {
"url": "https://api.openai.com/v1",
"auth": {
"type": "api-key",
"header": "Authorization",
"value": "Bearer sk-your-api-key"
}
},
"accessControl": {
"mode": "deny_all",
"exceptions": [
{
"path": "/chat/completions",
"methods": [
"POST"
]
},
{
"path": "/models",
"methods": [
"GET"
]
},
{
"path": "/models/{modelId}",
"methods": [
"GET"
]
}
]
}
},
"status": {
"id": "wso2-openai-provider",
"state": "deployed",
"createdAt": "2026-04-24T07:21:13Z",
"updatedAt": "2026-04-24T07:21:13Z",
"deployedAt": "2026-04-24T07:21:13Z"
}
}

Responses​

StatusMeaningDescriptionSchema
201CreatedLLM provider created and deployed successfullyLLMProviderConfiguration
400Bad RequestInvalid configuration (validation failed)ErrorResponse
409ConflictConflict - Provider with same name and version already existsErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

List all LLM providers​

GET /llm-providers

Code samples


curl -X GET http://localhost:9090/api/management/v0.9/llm-providers \
-u {username}:{password} \
-H 'Accept: application/json'

List LLM providers registered in the Gateway, optionally filtered by name, version, context, status, or vhost.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
displayNamequerystringfalseFilter by LLM provider display name
versionquerystringfalseFilter by LLM provider version
contextquerystringfalseFilter by LLM provider context/path
statusquerystringfalseFilter by deployment status
vhostquerystringfalseFilter by LLM provider vhost

Enumerated Values​

ParameterValue
statusdeployed
statusundeployed

Example responses

200 Response

{
"status": "success",
"count": 2,
"providers": [
{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "LlmProvider",
"metadata": {
"name": "wso2-openai-provider"
},
"spec": {
"displayName": "OpenAI Provider",
"version": "v1.0",
"template": "openai",
"context": "/openai/latest",
"upstream": {
"url": "https://api.openai.com/v1",
"auth": {
"type": "api-key",
"header": "Authorization",
"value": "Bearer sk-your-api-key"
}
},
"accessControl": {
"mode": "deny_all",
"exceptions": [
{
"path": "/chat/completions",
"methods": [
"POST"
]
},
{
"path": "/models",
"methods": [
"GET"
]
},
{
"path": "/models/{modelId}",
"methods": [
"GET"
]
}
]
}
},
"status": {
"id": "wso2-openai-provider",
"state": "deployed",
"createdAt": "2026-04-24T07:21:13Z",
"updatedAt": "2026-04-24T07:21:13Z",
"deployedAt": "2026-04-24T07:21:13Z"
}
}
]
}

Responses​

StatusMeaningDescriptionSchema
200OKList of LLM providersInline
500Internal Server ErrorInternal server errorErrorResponse

Response Schema​

Status Code 200

NameTypeRequiredRestrictionsDescription
statusstringfalsenonenone
countintegerfalsenonenone
providers[allOf]falsenonenone

allOf

NameTypeRequiredRestrictionsDescription
anonymousLLMProviderConfigurationRequestfalsenonenone
apiVersionstringtruenoneProvider specification version
kindstringtruenoneProvider kind
metadataMetadatatruenonenone
namestringtruenoneUnique handle for the resource
labelsobjectfalsenoneLabels are key-value pairs for organizing and selecting APIs. Keys must not contain spaces.
additionalPropertiesstringfalsenonenone
annotationsobjectfalsenoneAnnotations are arbitrary non-identifying metadata. Use domain-prefixed keys.
additionalPropertiesstringfalsenonenone
specLLMProviderConfigDatatruenonenone
displayNamestringtruenoneHuman-readable LLM Provider name
versionstringtruenoneSemantic version of the LLM Provider
contextstringfalsenoneBase path for all API routes (must start with /, no trailing slash)
vhoststringfalsenoneVirtual host name used for routing. Supports standard domain names, subdomains, or wildcard domains. Must follow RFC-compliant hostname rules. Wildcards are only allowed in the left-most label (e.g., *.example.com).
templatestringtruenoneTemplate name to use for this LLM Provider
upstreamanytruenonenone

allOf

NameTypeRequiredRestrictionsDescription
anonymousUpstreamfalsenoneUpstream backend configuration (single target or reference)
urlstring(uri)falsenoneDirect backend URL to route traffic to
refstringfalsenoneReference to a predefined upstreamDefinition
hostRewritestringfalsenoneControls how the Host header is handled when routing to the upstream. auto delegates host rewriting to Envoy, which rewrites the Host header using the upstream cluster host. manual disables automatic rewriting and expects explicit configuration.

oneOf

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone

and

NameTypeRequiredRestrictionsDescription
anonymousUpstreamAuthfalsenonenone
authobjectfalsenonenone
typestringtruenonenone
headerstringfalsenonenone
valuestringfalsenonenone

continued

NameTypeRequiredRestrictionsDescription
accessControlLLMAccessControltruenonenone
modestringtruenoneAccess control mode
exceptions[RouteException]falsenonePath exceptions to the access control mode
pathstringtruenonePath pattern
methods[string]truenoneHTTP methods
policies[LLMPolicy]falsenoneList of policies applied only to this operation (overrides or adds to API-level policies)
namestringtruenonenone
versionstringtruenonenone
paths[LLMPolicyPath]truenonenone
pathstringtruenonenone
methods[string]truenonenone
paramsobjecttruenoneJSON Schema describing the parameters accepted by this policy. This itself is a JSON Schema document.
deploymentStatestringfalsenoneDesired deployment state - 'deployed' (default) or 'undeployed'. When set to 'undeployed', the LLM Provider is removed from router traffic but configuration and policies are preserved for potential redeployment.

and

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
statusResourceStatusfalseread-onlyServer-managed lifecycle fields. Populated on responses.
idstringfalsenoneUnique identifier assigned by the server (equal to metadata.name)
statestringfalsenoneDesired deployment state reported by the server
createdAtstring(date-time)falsenoneTimestamp when the resource was first created (UTC)
updatedAtstring(date-time)falsenoneTimestamp when the resource was last updated (UTC)
deployedAtstring(date-time)falsenoneTimestamp when the resource was last deployed (omitted when undeployed)

Enumerated Values​

PropertyValue
apiVersiongateway.api-platform.wso2.com/v1alpha1
kindLlmProvider
hostRewriteauto
hostRewritemanual
typeapi-key
modeallow_all
modedeny_all
deploymentStatedeployed
deploymentStateundeployed
statedeployed
stateundeployed

Get LLM provider by identifier​

GET /llm-providers/{id}

Code samples


curl -X GET http://localhost:9090/api/management/v0.9/llm-providers/{id} \
-u {username}:{password} \
-H 'Accept: application/json'

Get an LLM provider by its ID.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique identifier of the LLM provider

Example responses

200 Response

{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "LlmProvider",
"metadata": {
"name": "wso2-openai-provider"
},
"spec": {
"displayName": "OpenAI Provider",
"version": "v1.0",
"template": "openai",
"context": "/openai/latest",
"upstream": {
"url": "https://api.openai.com/v1",
"auth": {
"type": "api-key",
"header": "Authorization",
"value": "Bearer sk-your-api-key"
}
},
"accessControl": {
"mode": "deny_all",
"exceptions": [
{
"path": "/chat/completions",
"methods": [
"POST"
]
},
{
"path": "/models",
"methods": [
"GET"
]
},
{
"path": "/models/{modelId}",
"methods": [
"GET"
]
}
]
}
},
"status": {
"id": "wso2-openai-provider",
"state": "deployed",
"createdAt": "2026-04-24T07:21:13Z",
"updatedAt": "2026-04-24T07:21:13Z",
"deployedAt": "2026-04-24T07:21:13Z"
}
}

Responses​

StatusMeaningDescriptionSchema
200OKLLM provider detailsLLMProviderConfiguration
404Not FoundLLM provider not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Update an existing LLM provider​

PUT /llm-providers/{id}

Code samples


curl -X PUT http://localhost:9090/api/management/v0.9/llm-providers/{id} \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Update an existing LLM provider in the Gateway.

Payload

{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "LlmProvider",
"metadata": {
"name": "wso2-openai-provider"
},
"spec": {
"displayName": "OpenAI Provider",
"version": "v1.0",
"template": "openai",
"context": "/openai/latest",
"upstream": {
"url": "https://api.openai.com/v1",
"auth": {
"type": "api-key",
"header": "Authorization",
"value": "Bearer sk-your-api-key"
}
},
"accessControl": {
"mode": "deny_all",
"exceptions": [
{
"path": "/chat/completions",
"methods": [
"POST"
]
},
{
"path": "/models",
"methods": [
"GET"
]
},
{
"path": "/models/{modelId}",
"methods": [
"GET"
]
}
]
}
}
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique identifier of the LLM provider
bodybodyLLMProviderConfigurationRequesttrueUpdated LLM provider

Example responses

200 Response

{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "LlmProvider",
"metadata": {
"name": "wso2-openai-provider"
},
"spec": {
"displayName": "OpenAI Provider",
"version": "v1.0",
"template": "openai",
"context": "/openai/latest",
"upstream": {
"url": "https://api.openai.com/v1",
"auth": {
"type": "api-key",
"header": "Authorization",
"value": "Bearer sk-your-api-key"
}
},
"accessControl": {
"mode": "deny_all",
"exceptions": [
{
"path": "/chat/completions",
"methods": [
"POST"
]
},
{
"path": "/models",
"methods": [
"GET"
]
},
{
"path": "/models/{modelId}",
"methods": [
"GET"
]
}
]
}
},
"status": {
"id": "wso2-openai-provider",
"state": "deployed",
"createdAt": "2026-04-24T07:21:13Z",
"updatedAt": "2026-04-24T07:21:13Z",
"deployedAt": "2026-04-24T07:21:13Z"
}
}

Responses​

StatusMeaningDescriptionSchema
200OKLLM provider updated successfullyLLMProviderConfiguration
400Bad RequestInvalid configurationErrorResponse
404Not FoundLLM provider not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Delete an LLM provider​

DELETE /llm-providers/{id}

Code samples


curl -X DELETE http://localhost:9090/api/management/v0.9/llm-providers/{id} \
-u {username}:{password} \
-H 'Accept: application/json'

Delete an LLM provider from the Gateway.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique identifier of the LLM provider

Example responses

200 Response

{
"status": "success",
"message": "LLM provider deleted successfully",
"id": "wso2-openai-provider"
}

Responses​

StatusMeaningDescriptionSchema
200OKLLM provider deleted successfullyInline
404Not FoundLLM provider not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Response Schema​

Status Code 200

NameTypeRequiredRestrictionsDescription
statusstringfalsenonenone
messagestringfalsenonenone
idstringfalsenonenone

Create a new API key for an LLM provider​

POST /llm-providers/{id}/api-keys

Code samples


curl -X POST http://localhost:9090/api/management/v0.9/llm-providers/{id}/api-keys \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Generate a new API key for an LLM provider in the Gateway.

Payload

{
"name": "my-production-key"
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `consumer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique handle of the LLM provider to generate the key for
bodybodyAPIKeyCreationRequesttruenone

Example responses

201 Response

{
"status": "success",
"message": "API key generated successfully",
"remainingApiKeyQuota": 9,
"apiKey": {
"name": "my-production-key",
"displayName": "My Production Key",
"apiKey": "apip_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"apiId": "reading-list-api-v1.0",
"status": "active",
"createdAt": "2026-04-01T10:30:00Z",
"createdBy": "admin",
"expiresAt": null,
"source": "local"
}
}

Responses​

StatusMeaningDescriptionSchema
201CreatedAPI key created successfullyAPIKeyCreationResponse
400Bad RequestInvalid configuration (validation failed)ErrorResponse
404Not FoundLLM provider not foundErrorResponse
409ConflictConflict (duplicate key or conflicting update)ErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Get the list of API keys for an LLM provider​

GET /llm-providers/{id}/api-keys

Code samples


curl -X GET http://localhost:9090/api/management/v0.9/llm-providers/{id}/api-keys \
-u {username}:{password} \
-H 'Accept: application/json'

List all API keys for an LLM provider in the Gateway.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `consumer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique handle of the LLM provider to retrieve keys for

Example responses

200 Response

{
"apiKeys": [
{
"name": "my-production-key",
"displayName": "My Production Key",
"apiKey": "apip_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"apiId": "reading-list-api-v1.0",
"status": "active",
"createdAt": "2026-04-01T10:30:00Z",
"createdBy": "admin",
"expiresAt": null,
"source": "local"
}
],
"totalCount": 3,
"status": "success"
}

Responses​

StatusMeaningDescriptionSchema
200OKList of API keysAPIKeyListResponse
404Not FoundLLM provider not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Regenerate API key for an LLM provider​

POST /llm-providers/{id}/api-keys/{apiKeyName}/regenerate

Code samples


curl -X POST http://localhost:9090/api/management/v0.9/llm-providers/{id}/api-keys/{apiKeyName}/regenerate \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Regenerate an existing API key for an LLM provider in the Gateway.

Payload

{}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `consumer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique handle of the LLM provider
apiKeyNamepathstringtrueName of the API key to regenerate
bodybodyAPIKeyRegenerationRequesttruenone

Example responses

200 Response

{
"status": "success",
"message": "API key generated successfully",
"remainingApiKeyQuota": 9,
"apiKey": {
"name": "my-production-key",
"displayName": "My Production Key",
"apiKey": "apip_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"apiId": "reading-list-api-v1.0",
"status": "active",
"createdAt": "2026-04-01T10:30:00Z",
"createdBy": "admin",
"expiresAt": null,
"source": "local"
}
}

Responses​

StatusMeaningDescriptionSchema
200OKAPI key rotated successfullyAPIKeyCreationResponse
400Bad RequestInvalid configuration (validation failed)ErrorResponse
404Not FoundLLM provider or API key not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Update an API key for an LLM provider​

PUT /llm-providers/{id}/api-keys/{apiKeyName}

Code samples


curl -X PUT http://localhost:9090/api/management/v0.9/llm-providers/{id}/api-keys/{apiKeyName} \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Update an API key with a custom value instead of auto-generating one.

Payload

{
"name": "my-production-key"
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `consumer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique handle of the LLM provider
apiKeyNamepathstringtrueName of the API key to update
bodybodyAPIKeyUpdateRequesttruenone

Example responses

200 Response

{
"status": "success",
"message": "API key generated successfully",
"remainingApiKeyQuota": 9,
"apiKey": {
"name": "my-production-key",
"displayName": "My Production Key",
"apiKey": "apip_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"apiId": "reading-list-api-v1.0",
"status": "active",
"createdAt": "2026-04-01T10:30:00Z",
"createdBy": "admin",
"expiresAt": null,
"source": "local"
}
}

Responses​

StatusMeaningDescriptionSchema
200OKAPI key updated successfullyAPIKeyCreationResponse
400Bad RequestInvalid request (validation failed)ErrorResponse
404Not FoundLLM provider or API key not foundErrorResponse
409ConflictConflict (duplicate key or conflicting update)ErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Revoke an API key for an LLM provider​

DELETE /llm-providers/{id}/api-keys/{apiKeyName}

Code samples


curl -X DELETE http://localhost:9090/api/management/v0.9/llm-providers/{id}/api-keys/{apiKeyName} \
-u {username}:{password} \
-H 'Accept: application/json'

Revoke an API key. Once revoked, it can no longer be used to authenticate requests.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `consumer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique handle of the LLM provider
apiKeyNamepathstringtrueName of the API key to revoke

Example responses

200 Response

{
"status": "success",
"message": "API key revoked successfully"
}

Responses​

StatusMeaningDescriptionSchema
200OKAPI key revoked successfullyAPIKeyRevocationResponse
400Bad RequestInvalid configuration (validation failed)ErrorResponse
404Not FoundLLM provider or API key not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Was this page helpful?