К содержимому

Руководство разработчика

Справочник API Spectorn

Канонический контракт OpenAPI для шлюза Spectorn. Страница использует живую спецификацию шлюза, когда она доступна, и версионированный снимок в остальных случаях; аккаунты и доступ к API остаются закрыты релизным гейтом.

Spectorn AI Security Gatewayv0.1.0-sprint14Открыть снимок JSON
Указатель операций57
Base URL
https://api.global.spectorn.ai
Аутентификация
JWT Authorization: Bearer
Источник спецификации
Версионированный снимок

delete/v1/admin/account

Self-terminate account; revoke all keys (TOS §7.1)

account

Пример запросаcURL
curl -X DELETE \
  https://api.global.spectorn.ai/v1/admin/account \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/admin/detection-tuning

Read the live global detection tuning baseline

account

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/admin/detection-tuning \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

put/v1/admin/detection-tuning

Set or clear the live global detection tuning baseline

account

Пример запросаcURL
curl -X PUT \
  https://api.global.spectorn.ai/v1/admin/detection-tuning \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/admin/detection-tuning/reload

Reload the global detection tuning baseline from disk

account

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/admin/detection-tuning/reload \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/admin/eligibility/reviews

List Global Free eligibility reviews for platform triage

eligibility

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/admin/eligibility/reviews \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/admin/eligibility/reviews/{review_id}/decision

Approve, deny, or revoke a Global Free eligibility review

eligibility

Параметры

ИмяГдеТипОписание
review_idОбяз.pathstring
Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/admin/eligibility/reviews/{review_id}/decision \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/admin/keys

List API keys

account

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/admin/keys \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/admin/keys

Create an API key

account

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/admin/keys \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

delete/v1/admin/keys/{tenant_id}

Revoke all keys for a tenant

account

Параметры

ИмяГдеТипОписание
tenant_idОбяз.pathstring
Пример запросаcURL
curl -X DELETE \
  https://api.global.spectorn.ai/v1/admin/keys/{tenant_id} \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/admin/tenants/{tenant_id}/model-routes

Read a tenant's gateway model aliases

account

Параметры

ИмяГдеТипОписание
tenant_idОбяз.pathstringTarget tenant id
Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/admin/tenants/{tenant_id}/model-routes \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

put/v1/admin/tenants/{tenant_id}/model-routes

Replace a tenant's gateway model aliases

account

Параметры

ИмяГдеТипОписание
tenant_idОбяз.pathstringTarget tenant id
Пример запросаcURL
curl -X PUT \
  https://api.global.spectorn.ai/v1/admin/tenants/{tenant_id}/model-routes \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

put/v1/admin/tenants/{tenant_id}/policy

Set or clear a tenant's policy (null body clears to default)

account

Параметры

ИмяГдеТипОписание
tenant_idОбяз.pathstringTarget tenant id
Пример запросаcURL
curl -X PUT \
  https://api.global.spectorn.ai/v1/admin/tenants/{tenant_id}/policy \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/admin/tenants/{tenant_id}/scan-config

Read a tenant's scan mode + policy

account

Параметры

ИмяГдеТипОписание
tenant_idОбяз.pathstringTarget tenant id
Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/admin/tenants/{tenant_id}/scan-config \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

put/v1/admin/tenants/{tenant_id}/scan-mode

Set a tenant's scan enforcement mode (enforce/shadow)

account

Параметры

ИмяГдеТипОписание
tenant_idОбяз.pathstringTarget tenant id
Пример запросаcURL
curl -X PUT \
  https://api.global.spectorn.ai/v1/admin/tenants/{tenant_id}/scan-mode \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/admin/usage

Return content-free daily usage across all active tenants

account

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/admin/usage \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/audit/verify

Verify the audit log

verification

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/audit/verify \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/billing/checkout

Create a Stripe Checkout session

account

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/billing/checkout \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/billing/status

Read the webhook-backed tenant billing entitlement

account

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/billing/status \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/chat/completions

OpenAI-compatible stateless gateway proxy: scan, route, then forward to the model

gateway

Structured gateway failures use JSON. Provider-origin responses can use the provider's media type, but response bodies are not byte-for-byte passthrough: gateway scanning, masking, model-alias sanitation, billing, and hosted-provider controls may buffer, transform, terminate, withhold, or replace them. Legacy stream:true can return gateway-scanned text/event-stream data or be downgraded to buffered JSON; the default response documents non-enumerated provider statuses.

Параметры

ИмяГдеТипОписание
X-Provider-KeyheaderstringBYOK upstream provider key when no provider is configured in the dashboard
X-ProviderheaderstringRoute to a configured provider without prefixing the model name
X-Spectorn-SessionheaderstringReserved for the project-scoped chat route. Any present value on this legacy stateless route is rejected with 409 memory_scope_required.
X-Spectorn-Turn-IdheaderstringReserved for the project-scoped chat route. Any present value on this legacy stateless route is rejected with 409 memory_scope_required.
Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/chat/completions \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
Gateway-processed upstream success. Non-streaming JSON may be sanitized, restored, or re-serialized; stream:true can return gateway-scanned SSE that may terminate with a gateway-generated error event; other provider media types can be returned on non-streaming paths.
400
The gateway rejected an invalid request, or the upstream provider returned 400. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
401
The gateway rejected authentication, or an authenticated forwarded request received upstream 401. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
402
Billing balance or output-token allowance requires payment, or the upstream provider returned 402. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
403
Authentication scope, eligibility, prompt policy, output policy, or billing policy refused the request, or the upstream provider returned 403. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
408
The gateway request timed out, or the upstream provider returned 408. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
409
Any present X-Spectorn-Session or X-Spectorn-Turn-Id value is rejected with memory_scope_required, or an authenticated forwarded request received upstream 409. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
413
HTTP body or prompt exceeded its bound, or the upstream provider returned 413. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
429
The gateway or upstream provider rate-limited the request. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
500
The gateway failed internally, or the upstream provider returned 500. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
502
Upstream resolution, transport, or response-size failure, or the upstream provider returned 502. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
503
Scan, billing, or eligibility dependency unavailable, or the upstream provider returned 503. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
504
The upstream provider returned 504 Gateway Timeout. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
default
A non-enumerated response status selected from the upstream provider. Its media type and JSON shape are provider-defined; gateway controls may transform, terminate, withhold, or replace the payload

get/v1/dashboard-template

Grafana dashboard template

verification

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/dashboard-template \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
500
Internal error

post/v1/dispute/file

File a dispute (TOS §7.3)

account

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/dispute/file \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/dispute/list

List the authenticated tenant's own disputes

account

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/dispute/list \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/eligibility/reviews

Submit a structured Global Free eligibility review

eligibility

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/eligibility/reviews \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/eligibility/reviews/current

Read the caller tenant's current Global Free eligibility review

eligibility

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/eligibility/reviews/current \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/engines

Full canonical list of available engines

verification

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/engines \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/explain/{verdict_id}

Fetch a causal chain for a verdict

verification

Параметры

ИмяГдеТипОписание
verdict_idОбяз.pathstring
Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/explain/{verdict_id} \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/gateway/capabilities

Return tenant gateway capabilities and available model aliases

gateway

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/gateway/capabilities \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/health

Liveness probe (process responding)

verification

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/health \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
500
Internal error

post/v1/logout

Logout the current browser session

account

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/logout \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
500
Internal error

delete/v1/memory/all

Delete all tenant memory

memory

Пример запросаcURL
curl -X DELETE \
  https://api.global.spectorn.ai/v1/memory/all \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/memory/export

Export tenant memory

memory

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/memory/export \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/memory/projects/{project_id}/chat/completions

OpenAI-compatible gateway proxy with exact project/session recall and store

gateway

Structured gateway failures use JSON. Scoped stream:true is always buffered and disclosed through X-Spectorn-Stream-Downgraded. The gateway reserves prepaid billing before walking the provider chain. A durable cross-process claim is acquired only after a sendable provider request has been built, then its owner begins execution immediately before the first provider dispatch. Thus a billing refusal or wholly unsendable provider chain creates no durable claim state. A configured fallback chain can contact multiple providers, so the guarantee is at-most-one dispatch chain, not provider exactly-once. CLAIMED leases may expire before dispatch; EXECUTING is never stolen, becomes durably UNCERTAIN after its deadline, and both UNCERTAIN and COMPLETED fail closed. Exact response bytes are not persisted for replay, so completed retries return memory_turn_replay_unavailable without a new provider call. Reusing the turn id with a different canonical request returns memory_turn_conflict. Provider-origin errors can use the provider's media type, while gateway controls may transform, withhold, or replace their payloads. Exact error responses allow gateway JSON and arbitrary upstream media; the default response documents non-enumerated provider statuses.

Параметры

ИмяГдеТипОписание
project_idОбяз.pathstring
X-Spectorn-SessionОбяз.headerstringExact session boundary inside the path project
X-Spectorn-Turn-IdОбяз.headerstringCaller occurrence token for one logical turn. Reuse it only with the same canonical caller request; use a new value for every new turn. A durable cross-process claim permits at most one provider dispatch chain for the canonical project/session/turn/request identity. The winning fallback chain may contact multiple providers, so this is not provider exactly-once. Because exact response bytes are not durably replayed, a retry after dispatch began, became uncertain, or completed returns a typed 409 and never starts a fresh provider chain.
X-Provider-Keyheaderstring
X-Providerheaderstring
Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/memory/projects/{project_id}/chat/completions \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
Buffered upstream success accepted for exact recall/store semantics and committed as the durable completed turn. Matching retries are not replayed and do not launch a fresh provider chain. The JSON body may be sanitized, restored, or re-serialized, and the provider-declared media type can be retained.
400
Invalid project id or unrepresentable chat request (memory_user_turn_required or memory_request_not_storable), or the upstream provider returned 400. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
401
The gateway rejected authentication, or an authenticated forwarded request received upstream 401. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
402
Billing balance or output-token allowance requires payment, or the upstream provider returned 402. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
403
Authentication scope, eligibility, prompt policy, output policy, or billing policy refused the request, or the upstream provider returned 403. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
408
The scoped operation timed out, or the upstream provider returned 408. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
409
Missing or malformed exact session/turn scope (memory_scope_required or memory_turn_id_required); a conflicting request_ref (memory_turn_conflict); a live claim or execution (memory_turn_claimed or memory_turn_execution_in_progress); a stale execution with an unknowable provider outcome (memory_turn_outcome_uncertain); a completed turn whose exact response cannot be replayed (memory_turn_replay_unavailable); or the upstream provider returned 409. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
413
HTTP body, prompt, or prompt plus recalled memory exceeded its bound, or the upstream provider returned 413. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
423
Session memory operation blocked by runtime self-defense mode, or the upstream provider returned 423. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
429
The gateway or upstream provider rate-limited the request. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
500
The gateway failed internally, or the upstream provider returned 500. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
502
Memory backend, upstream resolution, transport, or response-size failure, or the upstream provider returned 502. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
503
Session memory, scan, billing, or eligibility dependency unavailable, or the upstream provider returned 503. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
504
The upstream provider returned 504 Gateway Timeout. Structured gateway failures use application/json; provider-origin media and JSON shapes are provider-defined, and transport fallbacks can use any media type. Gateway controls may transform, terminate, withhold, or replace the payload
default
A non-enumerated response status selected from the upstream provider. Its media type and JSON shape are provider-defined; gateway controls may transform, terminate, withhold, or replace the payload

post/v1/memory/projects/{project_id}/export

Export one explicit memory project

memory

Параметры

ИмяГдеТипОписание
project_idОбяз.pathstringExplicit project boundary. The legacy default project is available only through /v1/memory/store, /search, /stats, and /export.
Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/memory/projects/{project_id}/export \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
Project-scoped memory export
400
Invalid project identifier or scoped request arguments
401
Missing or invalid API key
403
Authenticated request refused by API-key scope, eligibility, or browser CSRF controls
408
Request timed out before the scoped operation completed
413
Configured memory export bound exceeded
423
Runtime self-defense mode blocked the operation
429
Rate limit exceeded
500
Internal error
502
Memory backend did not confirm the requested project scope
503
Memory or scan backend unavailable
504
Memory backend timed out

get/v1/memory/projects/{project_id}/search

Search one explicit memory project

memory

Параметры

ИмяГдеТипОписание
project_idОбяз.pathstringExplicit project boundary. The legacy default project is available only through /v1/memory/store, /search, /stats, and /export.
qОбяз.querystring
limitqueryinteger
modequerystring
Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/memory/projects/{project_id}/search \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
Project-scoped facts
400
Invalid project identifier or scoped request arguments
401
Missing or invalid API key
403
Authenticated request refused by API-key scope or eligibility controls, or protection policy blocked the search query
408
Request timed out before the scoped operation completed
413
A stored fact identity, stored fact payload, or aggregate search scope exceeds the bounded search limit
423
Runtime self-defense mode blocked the operation
429
Rate limit exceeded
500
Internal error
502
Memory backend did not confirm the requested project scope
503
Memory or scan backend unavailable
504
Memory backend timed out

get/v1/memory/projects/{project_id}/stats

Summarize one explicit memory project

memory

Параметры

ИмяГдеТипОписание
project_idОбяз.pathstringExplicit project boundary. The legacy default project is available only through /v1/memory/store, /search, /stats, and /export.
Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/memory/projects/{project_id}/stats \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
Project-scoped memory statistics
400
Invalid project identifier or scoped request arguments
401
Missing or invalid API key
403
Authenticated request refused by API-key scope, eligibility, or browser CSRF controls
408
Request timed out before the scoped operation completed
413
A stored stats domain, aggregate domain scope, or domain count exceeds the bounded statistics limit
423
Runtime self-defense mode blocked the operation
429
Rate limit exceeded
500
Internal error
502
Memory backend did not confirm the requested project scope
503
Memory or scan backend unavailable
504
Memory backend timed out

post/v1/memory/projects/{project_id}/store

Store a fact in one explicit memory project

memory

Параметры

ИмяГдеТипОписание
project_idОбяз.pathstringExplicit project boundary. The legacy default project is available only through /v1/memory/store, /search, /stats, and /export.
Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/memory/projects/{project_id}/store \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
Exact project-scoped fact replayed without mutation
201
Project-scoped fact stored
400
Invalid project identifier or scoped request arguments
401
Missing or invalid API key
403
Authenticated request refused by API-key scope, eligibility, or browser CSRF controls, or protection policy blocked caller content
408
Request timed out before the scoped operation completed
409
Exact fact identity conflicts with a different live fact, or the project is not writable
413
Configured memory store size bound exceeded
423
Runtime self-defense mode blocked the operation
429
Rate limit exceeded
500
Internal error
502
Memory backend did not confirm the requested project scope
503
Memory or scan backend unavailable
504
Memory backend timed out

get/v1/memory/search

Search tenant memory

memory

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/memory/search \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/memory/store

Store a tenant memory fact

memory

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/memory/store \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/metrics

Prometheus metrics

verification

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/metrics \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
500
Internal error

get/v1/metrics/aggregate

Privacy-safe aggregate Prometheus metrics

verification

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/metrics/aggregate \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
500
Internal error

get/v1/model-routes

Read the caller tenant's gateway model aliases

gateway

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/model-routes \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

put/v1/model-routes

Replace the caller tenant's gateway model aliases

gateway

Пример запросаcURL
curl -X PUT \
  https://api.global.spectorn.ai/v1/model-routes \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/models

List customer-visible gateway model aliases

gateway

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/models \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/observe

Structured observation unavailable pending tenant-state isolation

scan

Недоступно: сервер держит операцию выключенной и отклоняет каждый вызов.

Fail-closed until authenticated per-tenant state isolation and cross-tenant tests are complete. The request body is not parsed or dispatched if the request reaches the disabled handler. Transport, authentication, eligibility, and rate-limit middleware can reject it first.

Ответы

400
Client protocol negotiation rejected the request before authentication
401
Missing or invalid API key
403
Authenticated request refused by scope, eligibility, or browser CSRF controls
408
Request timed out before the disabled handler completed
429
Rate limit exceeded
500
Transport or middleware failure
503
Structured observation is disabled. Authentication eligibility middleware can also fail closed with 503 before the handler is reached.

get/v1/public/channel-matrix

Signed channel-matrix envelope (Constitution §12)

verification

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/public/channel-matrix \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
500
Internal error

get/v1/public/firewall-attestation

Signed firewall-attestation envelope (Constitution §11)

verification

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/public/firewall-attestation \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
500
Internal error

get/v1/public/models

List the public gateway model catalog preview

gateway

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/public/models \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
500
Internal error

post/v1/scan

Analyze a prompt with one engine or the full registry

scan

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/scan \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
Пример ответа
{
  "confidence": 0.99,
  "action": "BLOCK",
  "flags": ["PROMPT_INJECTION"],
  "latency_ms": 1.25
}
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/scan/artifact

Scan a model artifact byte stream

scan

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/scan/artifact \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/scan/target

Analyze exactly one declared user or assistant target

scan

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/scan/target \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

get/v1/security/self-defense

Return runtime self-defense mode and recent security events

security

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/security/self-defense \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/security/self-defense/recover

Recover runtime self-defense mode after operator review

security

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/security/self-defense/recover \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "example input"}'

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/signup

Request a signup magic link

account

Недоступно на серверах Spectorn: граничные узлы RU и Global отвечают 426, и запрос не доходит до сервера.

Closed on hosted Spectorn: the RU and Global edges answer 426 before the request reaches the server. Self-hosted deployments decide availability at their own edge.

Ответы

200
OK
400
Bad request
426
Hosted Spectorn edge refused the request before it reached the server
500
Internal error

get/v1/signup/verify

Render signup magic-link confirmation

account

Недоступно на серверах Spectorn: граничные узлы RU и Global отвечают 426, и запрос не доходит до сервера.

Closed on hosted Spectorn: the RU and Global edges answer 426 before the request reaches the server. Self-hosted deployments decide availability at their own edge.

Ответы

200
OK
400
Bad request
426
Hosted Spectorn edge refused the request before it reached the server
500
Internal error

post/v1/signup/verify

Consume a signup magic-link token

account

Недоступно на серверах Spectorn: граничные узлы RU и Global отвечают 426, и запрос не доходит до сервера.

Closed on hosted Spectorn: the RU and Global edges answer 426 before the request reaches the server. Self-hosted deployments decide availability at their own edge.

Ответы

200
OK
400
Bad request
426
Hosted Spectorn edge refused the request before it reached the server
500
Internal error

get/v1/usage

Return current tenant usage summary

account

Пример запросаcURL
curl -X GET \
  https://api.global.spectorn.ai/v1/usage \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal error

post/v1/webhooks/stripe

Receive Stripe webhook events

billing

Пример запросаcURL
curl -X POST \
  https://api.global.spectorn.ai/v1/webhooks/stripe \
  -H "Authorization: Bearer $SPECTORN_API_KEY" \
  -H "Content-Type: application/json"

Ответы

200
OK
400
Bad request
500
Internal error
Описание

Spectorn — AI security verdict service (Track 1) + hybrid LLM gateway (Tracks 2/3/4 launching Sprint 15-17). Constitution v0.2 (12 falsifiable principles, two non-amendable). Per Constitution Принцип 12, every response includes a `channel_disclosed` field; responses can be independently verified using the open-source `spct-verify-channel` CLI. See SPECTORN_CONSTITUTION_DRAFT.md and SPECTORN_TOS_DRAFT.md в the source repository.

Справочник API | Spectorn