Skip to main content
PATCH
/
projects
/
{id}
/
limits
JavaScript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
  apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
});

const projectLimits = await client.projects.limits.update('id');

console.log(projectLimits.max_concurrent_invocations);
import os
from kernel import Kernel

client = Kernel(
api_key=os.environ.get("KERNEL_API_KEY"), # This is the default and can be omitted
)
project_limits = client.projects.limits.update(
id="id",
)
print(project_limits.max_concurrent_invocations)
package main

import (
"context"
"fmt"

"github.com/kernel/kernel-go-sdk"
"github.com/kernel/kernel-go-sdk/option"
)

func main() {
client := kernel.NewClient(
option.WithAPIKey("My API Key"),
)
projectLimits, err := client.Projects.Limits.Update(
context.TODO(),
"id",
kernel.ProjectLimitUpdateParams{
UpdateProjectLimitsRequest: kernel.UpdateProjectLimitsRequestParam{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", projectLimits.MaxConcurrentInvocations)
}
curl --request PATCH \
--url https://api.onkernel.com/projects/{id}/limits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"max_concurrent_sessions": 123,
"max_concurrent_invocations": 123,
"max_pooled_sessions": 123
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onkernel.com/projects/{id}/limits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'max_concurrent_sessions' => 123,
'max_concurrent_invocations' => 123,
'max_pooled_sessions' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.patch("https://api.onkernel.com/projects/{id}/limits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"max_concurrent_sessions\": 123,\n \"max_concurrent_invocations\": 123,\n \"max_pooled_sessions\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.onkernel.com/projects/{id}/limits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"max_concurrent_sessions\": 123,\n \"max_concurrent_invocations\": 123,\n \"max_pooled_sessions\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "max_concurrent_sessions": 10,
  "max_concurrent_invocations": 20,
  "max_pooled_sessions": 50
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Project ID

Body

application/json
max_concurrent_sessions
integer | null

Maximum concurrent browser sessions for this project. Set to 0 to remove the cap; omit to leave unchanged.

max_concurrent_invocations
integer | null

Maximum concurrent app invocations for this project. Set to 0 to remove the cap; omit to leave unchanged.

max_pooled_sessions
integer | null

Maximum pooled sessions capacity for this project. Set to 0 to remove the cap; omit to leave unchanged.

Response

Project limits updated

max_concurrent_sessions
integer | null

Maximum concurrent browser sessions for this project. Null means no project-level cap.

Example:

10

max_concurrent_invocations
integer | null

Maximum concurrent app invocations for this project. Null means no project-level cap.

Example:

20

max_pooled_sessions
integer | null

Maximum pooled sessions capacity for this project. Null means no project-level cap.

Example:

50