API

SparkCreditAgentUsage

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
GET /api/v1/organizations/{org_slug}/spark_credits/agent_usage/{agent_id} load Daily inference cost and compute minutes for one agent

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

spark_credit_agent_usage, err := client.SparkCreditAgentUsage(nil).Load(map[string]any{"id": "example_id", "organization_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(spark_credit_agent_usage)

Lua

Construct client as shown in the Lua setup, then call the operations:

local spark_credit_agent_usage, err = client:SparkCreditAgentUsage():load({ id = "example_id", organization_id = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$spark_credit_agent_usage = $client->SparkCreditAgentUsage()->load(["id" => "example_id", "organization_id" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

spark_credit_agent_usage = client.SparkCreditAgentUsage().load({"id": "example_id", "organization_id": "example"})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

spark_credit_agent_usage = client.SparkCreditAgentUsage.load({ "id" => "example_id", "organization_id" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const spark_credit_agent_usage = await client.SparkCreditAgentUsage().load({ id: "example_id", organization_id: "example" })

Fields

Field Type Required Description
agents array Yes Agents
all object Yes All
days array Yes Days
id string No Id
owners array Yes Owners

load

GET /api/v1/organizations/{org_slug}/spark_credits/agent_usage/{agent_id}

Operation ID: get_api_v1_organizations_org_slug_spark_credits_agent_usage_agent_id_.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
org_slug path string Yes
agent_id path string Yes

Responses

200: Daily inference cost and compute minutes for one agent

application/json

Property Type Required Description
agents array of object Yes
agents[].key string Yes
agents[].label string Yes
agents[].points array of object Yes
agents[].points[].compute_minutes number Yes
agents[].points[].inference_usd number Yes
agents[].total object Yes
agents[].total.compute_minutes number Yes
agents[].total.inference_usd number Yes
all object Yes
all.key string Yes
all.label string Yes
all.points array of object Yes
all.points[].compute_minutes number Yes
all.points[].inference_usd number Yes
all.total object Yes
all.total.compute_minutes number Yes
all.total.inference_usd number Yes
days array of string (date) Yes
owners array of object Yes
owners[].key string Yes
owners[].label string Yes
owners[].points array of object Yes
owners[].points[].compute_minutes number Yes
owners[].points[].inference_usd number Yes
owners[].total object Yes
owners[].total.compute_minutes number Yes
owners[].total.inference_usd number Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway