dev.cocore.inference.dispatch
{
"$type": "com.atproto.lexicon.schema",
"defs": {
"main": {
"description": "Submit an inference request and stream the result back as Server-Sent Events. Authenticates the requester, runs the dispatch core, and emits typed SSE frames. Unlike `submit` (which returns URIs to poll), `dispatch` drives the full request and streams plaintext output chunks until completion.\n\nConfidentiality: by default the AppView seals the prompt to the chosen provider on the caller's behalf (`best-effort` tier) — convenient, but the AppView is in the plaintext path. A caller that needs privacy FROM the provider sets `requireConfidential` and supplies a fresh `nonce`; the AppView then runs the verified, enclave-bound ephemeral handshake and either confirms an `attested-confidential` session or fails closed with the `ConfidentialUnavailable` error. For genuine end-to-end confidentiality the prompt is sealed at the client edge (SDK/browser) and the AppView forwards ciphertext only; this method's server-side seal path is always `best-effort`.\n\nSSE events:\n * `meta` — { jobUri, jobCid, authUri, inputCommitment, providerDid, sessionId, tier }\n * `sessionKey` — { ephemeralPubKey, nonce, attestationCid, signature } (only when `requireConfidential`; the enclave-signed fresh key the requester verifies before sealing)\n * `chunk` — { seq, text } (plaintext, decrypted)\n * `complete` — { tokensIn, tokensOut, receiptUri, tier, providerCredit? }\n * `error` — { reason, code }",
"errors": [
{
"description": "The caller is not authenticated.",
"name": "AuthRequired"
},
{
"description": "The body failed validation.",
"name": "InvalidRequest"
},
{
"description": "requireConfidential was set but no provider could satisfy the attested-confidential tier (no verified+bound MDA chain, cdHash not in the known-good set, posture failed, or the ephemeral session handshake did not verify). The request was NOT downgraded; no prompt was sealed.",
"name": "ConfidentialUnavailable"
}
],
"input": {
"encoding": "application/json",
"schema": {
"properties": {
"maxTokensOut": {
"minimum": 1,
"type": "integer"
},
"model": {
"minLength": 1,
"type": "string"
},
"nonce": {
"description": "Fresh lowercase-hex freshness challenge (>=16 random bytes) supplied by the caller when `requireConfidential` is set. The provider's enclave signs (ephemeralPubKey || nonce || attestationCid) so the caller can prove the ephemeral seal key was minted for THIS request and is not replayed. Required when requireConfidential is true; ignored otherwise.",
"maxLength": 64,
"minLength": 32,
"type": "string"
},
"outputSchema": {
"description": "Optional JSON Schema to constrain the model output. When present, the published job record carries this schema and the provider passes it to the inference engine as response_format guided decoding. The schema is public (not encrypted) — it describes the output shape, not the input.",
"properties": {
"name": {
"description": "Schema name (maps to OpenAI response_format.json_schema.name).",
"type": "string"
},
"schema": {
"description": "The actual JSON Schema object that constrains the model output.",
"type": "object"
},
"strict": {
"description": "Whether to enforce strict schema adherence.",
"type": "boolean"
}
},
"type": "object"
},
"priceCeiling": {
"properties": {
"amount": {
"minimum": 0,
"type": "integer"
},
"currency": {
"minLength": 1,
"type": "string"
}
},
"required": [
"amount",
"currency"
],
"type": "object"
},
"prompt": {
"minLength": 1,
"type": "string"
},
"requireConfidential": {
"description": "Demand the `attested-confidential` tier: the chosen provider must present a verified, signing-key-bound Apple MDA chain, a known-good measured cdHash, the hardened-runtime posture, and a fresh enclave-signed ephemeral session key bound to `nonce`. If no eligible provider is available the request fails closed with `ConfidentialUnavailable` rather than silently downgrading to best-effort. Optional / additive; absent or false means best-effort.",
"type": "boolean"
},
"targetProviderDid": {
"description": "Pin dispatch to a specific provider DID instead of letting the advisor route.",
"format": "did",
"type": "string"
},
"toolChoice": {
"description": "Optional tool choice strategy. 'auto' (default), 'none', or 'required'. Additive.",
"knownValues": [
"auto",
"none",
"required"
],
"type": "string"
},
"toolChoiceFunction": {
"description": "When toolChoice is 'required', force the model to call this specific function. Maps to OpenAI tool_choice object form. Additive.",
"maxLength": 256,
"type": "string"
},
"tools": {
"description": "Optional list of tool/function definitions the model may call. Public (not encrypted). The published job record carries this list and the provider passes it to the inference engine.",
"items": {
"properties": {
"function": {
"properties": {
"description": {
"maxLength": 4096,
"type": "string"
},
"name": {
"maxLength": 256,
"type": "string"
},
"parameters": {
"description": "JSON Schema for the function's arguments.",
"type": "object"
}
},
"required": [
"name"
],
"type": "object"
},
"type": {
"knownValues": [
"function"
],
"type": "string"
}
},
"required": [
"type",
"function"
],
"type": "object"
},
"maxLength": 128,
"type": "array"
}
},
"required": [
"model",
"prompt",
"maxTokensOut",
"priceCeiling"
],
"type": "object"
}
},
"output": {
"description": "A Server-Sent Events stream of `meta`, `chunk`, `complete`, and `error` frames (see the method description for payloads).",
"encoding": "text/event-stream"
},
"type": "procedure"
}
},
"id": "dev.cocore.inference.dispatch",
"lexicon": 1
}
Metadata
- DID
-
did:plc:5quuhkmwe2q4k3azfsgg7kdz - CID
-
bafyreifgxhv32r6w22nm3rfierzpag5c5bbeftj7xy53wzngjqoqw7mhiy - Indexed At
- 2026-07-26 20:05 UTC
- AT-URI
-
at://did:plc:5quuhkmwe2q4k3azfsgg7kdz/com.atproto.lexicon.schema/dev.cocore.inference.dispatch
Version History (3 versions)
Similar Lexicons
Lexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.
-
dev.cocore.inference.submit procedure
Submit an inference request for the authenticated requester. Builds a (paymentAuthorization, job) pair scoped to the configured exchange, publishes both to the requester's PDS, and returns the job/authorization URIs so …