Skip to content

Latest commit

 

History

History
1466 lines (1081 loc) · 113 KB

README.md

File metadata and controls

1466 lines (1081 loc) · 113 KB

AiGateway

Overview

Available Operations

createAiGatewayVirtualModelConfig

Create a virtual model config (VMC)

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.createAiGatewayVirtualModelConfig({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayCreateAiGatewayVirtualModelConfig } from "@vercel/sdk/funcs/aiGatewayCreateAiGatewayVirtualModelConfig.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayCreateAiGatewayVirtualModelConfig(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayCreateAiGatewayVirtualModelConfig failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.CreateAiGatewayVirtualModelConfigRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayVirtualModelConfig>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

getAiGatewayVirtualModelConfig

Get a virtual model config

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.getAiGatewayVirtualModelConfig({
    virtualModelSlug: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayGetAiGatewayVirtualModelConfig } from "@vercel/sdk/funcs/aiGatewayGetAiGatewayVirtualModelConfig.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayGetAiGatewayVirtualModelConfig(vercel, {
    virtualModelSlug: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayGetAiGatewayVirtualModelConfig failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.GetAiGatewayVirtualModelConfigRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.GetAiGatewayVirtualModelConfigResponseBody>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

updateAiGatewayVirtualModelConfig

Update a virtual model config

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.updateAiGatewayVirtualModelConfig({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayUpdateAiGatewayVirtualModelConfig } from "@vercel/sdk/funcs/aiGatewayUpdateAiGatewayVirtualModelConfig.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayUpdateAiGatewayVirtualModelConfig(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayUpdateAiGatewayVirtualModelConfig failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.UpdateAiGatewayVirtualModelConfigRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayVirtualModelConfig>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

deleteAiGatewayVirtualModelConfig

Delete a virtual model config (soft delete)

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.deleteAiGatewayVirtualModelConfig({
    virtualModelSlug: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayDeleteAiGatewayVirtualModelConfig } from "@vercel/sdk/funcs/aiGatewayDeleteAiGatewayVirtualModelConfig.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayDeleteAiGatewayVirtualModelConfig(vercel, {
    virtualModelSlug: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayDeleteAiGatewayVirtualModelConfig failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.DeleteAiGatewayVirtualModelConfigRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<any>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

listAiGatewayVirtualModelConfigs

List virtual model configs. For a team, returns all of its VMCs, or with limit or cursor one page ordered by virtualModelSlug. Across teams, pages newest-first. includeArchived=false omits archived VMCs.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.listAiGatewayVirtualModelConfigs({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayListAiGatewayVirtualModelConfigs } from "@vercel/sdk/funcs/aiGatewayListAiGatewayVirtualModelConfigs.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayListAiGatewayVirtualModelConfigs(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayListAiGatewayVirtualModelConfigs failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ListAiGatewayVirtualModelConfigsRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayVirtualModelConfigList>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

getAiGatewayVirtualModelConfigBySlug

Get a virtual model config by path slug

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.getAiGatewayVirtualModelConfigBySlug({
    vmcSlug: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayGetAiGatewayVirtualModelConfigBySlug } from "@vercel/sdk/funcs/aiGatewayGetAiGatewayVirtualModelConfigBySlug.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayGetAiGatewayVirtualModelConfigBySlug(vercel, {
    vmcSlug: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayGetAiGatewayVirtualModelConfigBySlug failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.GetAiGatewayVirtualModelConfigBySlugRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayVirtualModelConfig>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

updateAiGatewayVirtualModelConfigBySlug

Update a virtual model config by path slug

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.updateAiGatewayVirtualModelConfigBySlug({
    vmcSlug: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayUpdateAiGatewayVirtualModelConfigBySlug } from "@vercel/sdk/funcs/aiGatewayUpdateAiGatewayVirtualModelConfigBySlug.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayUpdateAiGatewayVirtualModelConfigBySlug(vercel, {
    vmcSlug: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayUpdateAiGatewayVirtualModelConfigBySlug failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.UpdateAiGatewayVirtualModelConfigBySlugRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayVirtualModelConfig>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

deleteAiGatewayVirtualModelConfigBySlug

Delete a virtual model config by path slug (soft delete)

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.deleteAiGatewayVirtualModelConfigBySlug({
    vmcSlug: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayDeleteAiGatewayVirtualModelConfigBySlug } from "@vercel/sdk/funcs/aiGatewayDeleteAiGatewayVirtualModelConfigBySlug.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayDeleteAiGatewayVirtualModelConfigBySlug(vercel, {
    vmcSlug: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayDeleteAiGatewayVirtualModelConfigBySlug failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.DeleteAiGatewayVirtualModelConfigBySlugRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<any>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

listAiGatewayRouters

List the authenticated team's active and archived custom routers.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.listAiGatewayRouters({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayListAiGatewayRouters } from "@vercel/sdk/funcs/aiGatewayListAiGatewayRouters.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayListAiGatewayRouters(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayListAiGatewayRouters failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ListAiGatewayRoutersRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayRouterList>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

createAiGatewayRule

Create a routing rule

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.createAiGatewayRule({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayCreateAiGatewayRule } from "@vercel/sdk/funcs/aiGatewayCreateAiGatewayRule.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayCreateAiGatewayRule(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayCreateAiGatewayRule failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.CreateAiGatewayRuleRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayRule>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

listAiGatewayRules

List the authenticated team's routing rules, oldest first. Without limit or cursor, returns every rule. With either, returns one page and a nextCursor for the next page (null on the last page). Paging reads and sorts the team's rules server-side, which is fine at current rule counts.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.listAiGatewayRules({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayListAiGatewayRules } from "@vercel/sdk/funcs/aiGatewayListAiGatewayRules.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayListAiGatewayRules(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayListAiGatewayRules failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ListAiGatewayRulesRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayRuleList>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

updateAiGatewayRule

Update a routing rule (enabled, action, or description)

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.updateAiGatewayRule({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayUpdateAiGatewayRule } from "@vercel/sdk/funcs/aiGatewayUpdateAiGatewayRule.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayUpdateAiGatewayRule(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayUpdateAiGatewayRule failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.UpdateAiGatewayRuleRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayRule>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

deleteAiGatewayRule

Delete a routing rule (soft delete)

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.deleteAiGatewayRule({
    ruleId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayDeleteAiGatewayRule } from "@vercel/sdk/funcs/aiGatewayDeleteAiGatewayRule.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayDeleteAiGatewayRule(vercel, {
    ruleId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayDeleteAiGatewayRule failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.DeleteAiGatewayRuleRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<any>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

listAiGatewayBudgets

List the team's AI Gateway budgets (team/project/user scopes, plus default-covered api-key spend) as a flat list, optionally filtered by scope. Without limit or cursor, returns every budget. With either, returns one page ordered by quotaEntityId plus nextCursor (null on the last page) and defaultCoveredCounts. Paging still reads the full merge server-side: the gateway meter list it joins has no cursor.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.listAiGatewayBudgets({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayListAiGatewayBudgets } from "@vercel/sdk/funcs/aiGatewayListAiGatewayBudgets.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayListAiGatewayBudgets(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayListAiGatewayBudgets failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ListAiGatewayBudgetsRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayBudgetList>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

upsertAiGatewayBudget

Create or update a team-, project-, or user-scope AI Gateway budget.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.upsertAiGatewayBudget({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayUpsertAiGatewayBudget } from "@vercel/sdk/funcs/aiGatewayUpsertAiGatewayBudget.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayUpsertAiGatewayBudget(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayUpsertAiGatewayBudget failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.UpsertAiGatewayBudgetRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayBudget>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

archiveAiGatewayBudget

Archive a team-, project-, or user-scope AI Gateway budget.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.archiveAiGatewayBudget({
    scopeType: "project",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayArchiveAiGatewayBudget } from "@vercel/sdk/funcs/aiGatewayArchiveAiGatewayBudget.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayArchiveAiGatewayBudget(vercel, {
    scopeType: "project",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayArchiveAiGatewayBudget failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ArchiveAiGatewayBudgetRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayBudget>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

listAiGatewayBudgetDefaults

List the team's AI Gateway budget defaults as a flat per-scope list (one row per team/project/api-key/user scope with a default set). An empty list is a normal state for the dashboard.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.listAiGatewayBudgetDefaults({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayListAiGatewayBudgetDefaults } from "@vercel/sdk/funcs/aiGatewayListAiGatewayBudgetDefaults.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayListAiGatewayBudgetDefaults(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayListAiGatewayBudgetDefaults failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ListAiGatewayBudgetDefaultsRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayBudgetDefaultList>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

upsertAiGatewayBudgetDefault

Create or update an AI Gateway budget default for one scope. Team-level authority only (owners/admins).

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.aiGateway.upsertAiGatewayBudgetDefault({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayUpsertAiGatewayBudgetDefault } from "@vercel/sdk/funcs/aiGatewayUpsertAiGatewayBudgetDefault.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayUpsertAiGatewayBudgetDefault(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("aiGatewayUpsertAiGatewayBudgetDefault failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.UpsertAiGatewayBudgetDefaultRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AiGatewayBudgetDefault>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

archiveAiGatewayBudgetDefault

Delete an AI Gateway budget default for one scope. Team-level authority only (owners/admins).

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  await vercel.aiGateway.archiveAiGatewayBudgetDefault({
    scopeType: "api-key",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });


}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { aiGatewayArchiveAiGatewayBudgetDefault } from "@vercel/sdk/funcs/aiGatewayArchiveAiGatewayBudgetDefault.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await aiGatewayArchiveAiGatewayBudgetDefault(vercel, {
    scopeType: "api-key",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    
  } else {
    console.log("aiGatewayArchiveAiGatewayBudgetDefault failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ArchiveAiGatewayBudgetDefaultRequest ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*