SSpiderIQ
SSpiderIQ

Docs / api-reference/dashboard-token-plans-ui

Dashboard - Token Plans (UI)

3 endpoints from the published OpenAPI import.

GET/api/v1/dashboard/client/token-plans

List my per-token plans (dashboard session)

The (token × service_type) grid scoped to the session's effective client. Same shape as the admin + Bearer lists, but only ever this client's own tokens. super_admin sees the impersonated client (X-Selected-Client-Id / X-Brand-ID).

Try it

Examples

cURL
curl -X GET 'https://spideriq.ai/api/v1/dashboard/client/token-plans' \
  -H 'Authorization: Bearer <token>'
Python
import httpx

resp = httpx.get(
    "https://spideriq.ai/api/v1/dashboard/client/token-plans",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
JavaScript
const resp = await fetch("https://spideriq.ai/api/v1/dashboard/client/token-plans", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
Go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://spideriq.ai/api/v1/dashboard/client/token-plans", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}

Responses

StatusDescription
200Successful Response
PUT/api/v1/dashboard/client/token-plans/{token_id}/{service_type}

Upsert one of my per-token plans (clamped to my client plan)

Partial upsert of a token's plan. The token must belong to the session's effective client (403 otherwise). Each supplied budget cap is clamped to the client's CSP cap; any field exceeding it returns 422 listing every violation. 404 when the client has no CSP for this service_type. Fires NOTIFY on write.

Parameters

NameInTypeRequiredDescription
token_idpathstringtrue
service_typepathstringtrue
Try it
Query

Examples

cURL
curl -X PUT 'https://spideriq.ai/api/v1/dashboard/client/token-plans/{token_id}/{service_type}' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "enabled": true,
  "jobs_per_hour": 0,
  "jobs_per_24h": 0,
  "monthly_cap_calendar": 0,
  "monthly_cap_period": "string",
  "cost_ceiling_usd_per_24h": 0.0,
  "monthly_spend_cap_usd": 0.0,
  "max_inflight_jobs": 0,
  "time_window_start": "string",
  "time_window_end": "string",
  "time_window_tz": "string",
  "priority_tier": 0
}'
Python
import httpx

resp = httpx.put(
    "https://spideriq.ai/api/v1/dashboard/client/token-plans/{token_id}/{service_type}",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"enabled": true, "jobs_per_hour": 0, "jobs_per_24h": 0, "monthly_cap_calendar": 0, "monthly_cap_period": "string", "cost_ceiling_usd_per_24h": 0.0, "monthly_spend_cap_usd": 0.0, "max_inflight_jobs": 0, "time_window_start": "string", "time_window_end": "string", "time_window_tz": "string", "priority_tier": 0},
)
resp.raise_for_status()
print(resp.json())
JavaScript
const resp = await fetch("https://spideriq.ai/api/v1/dashboard/client/token-plans/{token_id}/{service_type}", {
  method: "PUT",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"enabled": true, "jobs_per_hour": 0, "jobs_per_24h": 0, "monthly_cap_calendar": 0, "monthly_cap_period": "string", "cost_ceiling_usd_per_24h": 0.0, "monthly_spend_cap_usd": 0.0, "max_inflight_jobs": 0, "time_window_start": "string", "time_window_end": "string", "time_window_tz": "string", "priority_tier": 0})
});
const data = await resp.json();
console.log(data);
Go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"enabled": true, "jobs_per_hour": 0, "jobs_per_24h": 0, "monthly_cap_calendar": 0, "monthly_cap_period": "string", "cost_ceiling_usd_per_24h": 0.0, "monthly_spend_cap_usd": 0.0, "max_inflight_jobs": 0, "time_window_start": "string", "time_window_end": "string", "time_window_tz": "string", "priority_tier": 0}`)
	req, _ := http.NewRequest("PUT", "https://spideriq.ai/api/v1/dashboard/client/token-plans/{token_id}/{service_type}", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}

Responses

StatusDescription
200Successful Response
422Validation Error
DELETE/api/v1/dashboard/client/token-plans/{token_id}/{service_type}

Delete one of my per-token plans (revert to my client default)

Revert the token to the client default for this service_type. 403 if the token isn't the session client's; 404 if no override exists. Fires NOTIFY.

Parameters

NameInTypeRequiredDescription
token_idpathstringtrue
service_typepathstringtrue
Try it
Query

Examples

cURL
curl -X DELETE 'https://spideriq.ai/api/v1/dashboard/client/token-plans/{token_id}/{service_type}' \
  -H 'Authorization: Bearer <token>'
Python
import httpx

resp = httpx.delete(
    "https://spideriq.ai/api/v1/dashboard/client/token-plans/{token_id}/{service_type}",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
JavaScript
const resp = await fetch("https://spideriq.ai/api/v1/dashboard/client/token-plans/{token_id}/{service_type}", {
  method: "DELETE",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
Go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("DELETE", "https://spideriq.ai/api/v1/dashboard/client/token-plans/{token_id}/{service_type}", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}

Responses

StatusDescription
204Successful Response
422Validation Error