Skip to Content
kosemdocs
ReferenceAPIProviders

Create provider in organization

Adds a provider: an API key for a model provider. Its service must accept the key first. A project's own provider serves the project's own models alone, and is shared with no other project. Adding one fails with failed_precondition where a policy enforces llmgateway.projectProvidersDisabled.

POST
/v1/organizations/{organization}/providers

Adds a provider: an API key for a model provider. Its service must accept the key first.

A project's own provider serves the project's own models alone, and is shared with no other project. Adding one fails with failed_precondition where a policy enforces llmgateway.projectProvidersDisabled.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

organization*string

The organization's ID.

Match^org_[0-7][0-9a-hjkmnp-tv-z]{25}$

Query Parameters

validateOnly?boolean

Checks the provider, with its service too, without adding it.

Request Body

application/json
  1. body
apiKey?string

The API key, required for API_KEY types and refused for WORKLOAD_IDENTITY types. Its service must accept it first. Responses never include it.

Lengthlength <= 4096
availability?

The projects the provider is shared with. None, unless set. Setting it also takes llmgateway.providers.setAvailability. Only an organization's provider is shared.

config?

Settings, as the type's configFields describe them: keys of lowercase letters, digits and underscores, values of at most 2048 characters. Empty when adding a WORKLOAD_IDENTITY provider, which is configured once its cloud trusts it.

Propertiesproperties <= 20
displayName?string

Name shown in user interfaces. Defaults to the type's name.

Lengthlength <= 100
type*string

The provider's type, such as providerTypes/openai.

Match^providerTypes/[a-z][a-z0-9-]{0,62}$

Response Body

Created

application/json
  1. response
availability*

For an organization's provider: the projects it is shared with, which may make models of their own through it; a project's own model whose provider isn't shared with it serves nothing. The organization's models, and what projects adopted of them, serve wherever the models are shared, whomever the provider is shared with. A project's own provider is shared with none.

config*

Settings, as the type's configFields describe them.

createTime?string

When the provider was added; unset on one that was only validated.

Formatdate-time
displayName*string

Name shown in user interfaces. Defaults to the type's name.

keyHint*string

The last characters of the API key, to recognize it by; empty for providers connected by WORKLOAD_IDENTITY.

name*string

Resource name, organizations/{organization_id}/providers/{provider_id}, or projects/{project_id}/providers/{provider_id} for a project's own.

state*string

Whether the provider's service accepts the credential: ACTIVE, it accepted it when it was last verified; NEEDS_ATTENTION, it refused the credential or settings, or the provider isn't set up yet, and stateReason says why.

Value in"ACTIVE""NEEDS_ATTENTION"
stateReason*string

Why the provider needs attention.

trust?

What the cloud trusts of kosem for this provider, for a type connected by WORKLOAD_IDENTITY.

type*string

The provider's type, such as providerTypes/openai. It never changes.

updateTime?string

When the provider was last updated; unset on one that was only validated.

Formatdate-time
verifyTime*string

When the provider's service last accepted or refused the credential.

Formatdate-time
Example Request
curl -X POST 'https://api.kosem.ai/v1/organizations/string/providers' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "string"
}'
Example Response
{
  "availability": {
    "allProjects": true,
    "projects": [
      "string"
    ]
  },
  "config": {
    "property1": "string",
    "property2": "string"
  },
  "createTime": "2019-08-24T14:15:22Z",
  "displayName": "string",
  "keyHint": "string",
  "name": "string",
  "state": "ACTIVE",
  "stateReason": "string",
  "trust": {
    "attributeCondition": "string",
    "issuer": "string",
    "subject": "string"
  },
  "type": "string",
  "updateTime": "2019-08-24T14:15:22Z",
  "verifyTime": "2019-08-24T14:15:22Z"
}