Skip to Content
kosemdocs
ReferenceAPILlm gateway settings

Update LLM gateway settings in project

Changes the LLM gateway's settings of an organization or a project. The body is a JSON merge patch (RFC 7396), sent as application/merge-patch+json: a setting left out keeps its value, null unsets it, so that it takes what the level above makes apply, and a value replaces it, a list's whole. With If-Match, the update fails with failed_precondition, as 412, if the settings changed since it was read.

PATCH
/v1/projects/{project}/settings/llmGateway

Changes the LLM gateway's settings of an organization or a project.

The body is a JSON merge patch (RFC 7396), sent as application/merge-patch+json: a setting left out keeps its value, null unsets it, so that it takes what the level above makes apply, and a value replaces it, a list's whole. With If-Match, the update fails with failed_precondition, as 412, if the settings changed since it was read.

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}$

Header Parameters

If-Match?string

The ETag of the settings as they were read: the update fails with failed_precondition, as 412, if they changed since.

Request Body

application/merge-patch+json
  1. body
monthlySpendLimit?|

The most that requests here may cost in a calendar month (UTC), in US dollars, from $0 to $1,000,000,000, or null for no limit.

Response Body

OK

application/json
  1. response
effective*

What the level above makes apply, which a setting unset here takes: for a project, its organization's effective settings; for an organization, kosem's defaults.

inherited*

What the level above makes apply, which a setting unset here takes: for a project, its organization's effective settings; for an organization, kosem's defaults.

monthlySpendLimit?

The most that requests here may cost in a calendar month (UTC), in US dollars; absent while unset, which is no limit. An organization's limit counts all of its projects, and a project's only itself. Once a limit is reached, the gateway refuses requests until the month ends; requests already running may go a little past it. Only models whose prices kosem knows count.

name*string

Resource name, organizations/{organization_id}/settings/llmGateway or projects/{project_id}/settings/llmGateway.

updateTime?string

When the settings set here last changed; absent if they never did.

Formatdate-time
Example Request
curl -X PATCH 'https://api.kosem.ai/v1/projects/string/settings/llmGateway' \
  -H 'Content-Type: application/merge-patch+json' \
  -d '{}'
Example Response
{
  "effective": {
    "monthlySpendLimit": {
      "source": "organization",
      "value": {
        "currencyCode": "string",
        "nanos": -999999999,
        "units": 0
      }
    }
  },
  "inherited": {
    "monthlySpendLimit": {
      "source": "organization",
      "value": {
        "currencyCode": "string",
        "nanos": -999999999,
        "units": 0
      }
    }
  },
  "monthlySpendLimit": {
    "currencyCode": "string",
    "nanos": -999999999,
    "units": 0
  },
  "name": "string",
  "updateTime": "2019-08-24T14:15:22Z"
}