Skip to Content
kosemdocs
ReferenceAPIModels

Create model in project

Creates an organization's model, through one of its providers, which it shares with projects; or a project's, which adopts with source a model its organization shares with it, or goes with provider through the project's own provider or one its organization shares with it. Sharing an organization's model with projects (availability) also takes llmgateway.models.setAvailability. A project's model through its own provider fails with failed_precondition, and the reason POLICY_VIOLATED, where a policy enforces llmgateway.projectProvidersDisabled.

POST
/v1/projects/{project}/models

Creates an organization's model, through one of its providers, which it shares with projects; or a project's, which adopts with source a model its organization shares with it, or goes with provider through the project's own provider or one its organization shares with it.

Sharing an organization's model with projects (availability) also takes llmgateway.models.setAvailability. A project's model through its own provider fails with failed_precondition, and the reason POLICY_VIOLATED, where a policy enforces llmgateway.projectProvidersDisabled.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

project*string

The project's ID.

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

Request Body

application/json
  1. body
alias?string

What callers send as model in their requests, such as gpt-5 or fast; unique in the organization, or in the project. Letters, digits and .-_:/@, starting with a letter or a digit, at most 128. Required, but for a model a project adopts, whose alias is its source's unless set.

Match^[A-Za-z0-9][A-Za-z0-9._:/@-]{0,127}$
availability?

For an organization's model: the projects it is shared with, which may adopt it. None, unless set. Setting it also takes llmgateway.models.setAvailability.

displayName?string

Name shown in user interfaces. Defaults to the provider model's name, if kosem knows it, or to the alias; for an adopted model, to its source's.

Lengthlength <= 100
provider?string

The provider that requests go through: for an organization's model, one of its own; for a project's own model, the project's own, projects/{project_id}/providers/{provider_id}, or one its organization shares with it.

Match^(organizations/org|projects/prj)_[0-7][0-9a-hjkmnp-tv-z]{25}/providers/prv_[0-7][0-9a-hjkmnp-tv-z]{25}$
providerModel?string

With provider: the provider's name for the model, such as gpt-5-mini.

Lengthlength <= 256
source?string

For a project's model that adopts one of its organization's: that model, shared with the project. A project's model takes source, or provider and providerModel for one of its own.

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

Response Body

Created

application/json
  1. response
alias*string

What callers send as model in their requests, such as gpt-5 or fast; unique in the organization, or in the project for a project's model.

availability*

For an organization's model: the projects it is shared with, which may adopt it. A project's model is shared with none.

createTime*string

When the model was created.

Formatdate-time
displayName*string

Name shown in user interfaces. An adopted model shows its source's unless it has its own.

formats*array<>

The request formats the gateway serves, directly or by translation. Translation supports stateless generation; provider-specific features without an equivalent are refused.

info?

What kosem knows of the provider's model; absent when it does not know it.

name*string

Resource name, organizations/{organization_id}/models/{model_id} or projects/{project_id}/models/{model_id}.

nativeFormats*array<>

Formats served directly by the provider, without translation.

pricing?

The pricing given the model, as kosem knows no list prices for its provider's model; absent when it has none. Requests are priced at it, for usage and spend limits, while info.pricing is absent. An adopted model shows its source's.

provider*string

The provider that requests go through: organizations/{organization_id}/providers/{provider_id}, of the model's organization; or, for a project's own model, projects/{project_id}/providers/{provider_id}, the project's own. An adopted model shows its source's.

providerModel*string

The provider's name for the model, such as gpt-5-mini, which replaces alias in requests sent to it. An adopted model shows its source's.

providerType*string

The type of the model's provider, such as providerTypes/openai, which never changes. Those who may call the model see it, though they may not see the provider.

source*string

For a model a project adopted: the organization's model, organizations/{organization_id}/models/{model_id}, which serves its requests; empty for any other. Set when the model is created, and never changed.

state*string

Whether a project's model serves requests: NEEDS_ATTENTION, serving nothing, while its source, or its provider, its organization's, is no longer shared with its project, or while a policy enforces llmgateway.projectProvidersDisabled and it goes through the project's own provider. An organization's model is ACTIVE.

Value in"ACTIVE""NEEDS_ATTENTION"
stateReason*string

Why the model needs attention, when it does.

updateTime*string

When the model was last updated.

Formatdate-time
Example Request
curl -X POST 'https://api.kosem.ai/v1/projects/string/models' \
  -H 'Content-Type: application/json' \
  -d '{}'
Example Response
{
  "alias": "string",
  "availability": {
    "allProjects": true,
    "projects": [
      "string"
    ]
  },
  "createTime": "2019-08-24T14:15:22Z",
  "displayName": "string",
  "formats": [
    "ANTHROPIC_MESSAGES"
  ],
  "info": {
    "contextWindow": 0,
    "deprecated": true,
    "displayName": "string",
    "inputs": [
      "string"
    ],
    "maxInputTokens": 0,
    "maxOutputTokens": 0,
    "pricing": {
      "cacheRead": {
        "currencyCode": "string",
        "nanos": -999999999,
        "units": 0
      },
      "cacheWrite": {
        "currencyCode": "string",
        "nanos": -999999999,
        "units": 0
      },
      "input": {
        "currencyCode": "string",
        "nanos": -999999999,
        "units": 0
      },
      "output": {
        "currencyCode": "string",
        "nanos": -999999999,
        "units": 0
      }
    },
    "reasoning": true,
    "reasoningEfforts": [
      "string"
    ],
    "structuredOutput": true,
    "toolCalls": true
  },
  "name": "string",
  "nativeFormats": [
    "ANTHROPIC_MESSAGES"
  ],
  "pricing": {
    "cacheRead": {
      "currencyCode": "string",
      "nanos": -999999999,
      "units": 0
    },
    "cacheWrite": {
      "currencyCode": "string",
      "nanos": -999999999,
      "units": 0
    },
    "input": {
      "currencyCode": "string",
      "nanos": -999999999,
      "units": 0
    },
    "output": {
      "currencyCode": "string",
      "nanos": -999999999,
      "units": 0
    },
    "pricedLike": {
      "provider": "string",
      "providerModel": "string"
    }
  },
  "provider": "string",
  "providerModel": "string",
  "providerType": "string",
  "source": "string",
  "state": "ACTIVE",
  "stateReason": "string",
  "updateTime": "2019-08-24T14:15:22Z"
}