Skip to main content

GraphQL reference: ai-inference

Generated from the schema this service serves, so it cannot fall behind it. The same schema is published as a file for tools and agents.

Endpointhttps://<your-host>/api/ai-inference/graphql
Auth planeservice — Called by another DeviceChain service, not by an application. Documented for completeness; there is no supported way for a tenant client to call it.
Authorize withservice token
Schema file/schema/ai-inference.graphql
Described12 of 12 elements
NoteCalled by event-processing under its own service token when compiling a natural-language rule description. Not reachable with a tenant access token.

Queries​

aiInferenceInfo

aiInferenceInfo​

Identifies the service answering. Requires no specific authority.

Returns ServiceInfo!

Mutations​

inferRuleCandidate

inferRuleCandidate​

Drafts a detection rule: sends the prompt to the model the calling tenant has been assigned for rule drafting, or else its tier's default model, and returns the output unvalidated. The tenant comes from the caller's token. The call fails if the tenant's tier offers no usable model or the provider has no API key (the error is only "inference is unavailable", whatever the cause), if the tenant has not opted in to external AI routing (a distinct error), if the tenant is over its inference rate limit (a distinct, retryable error), or if the prompt is blank or too large. The function cannot be chosen by the caller. Requires ai:infer.

Returns InferenceResult!

ArgumentTypeDescription
requestInferenceRequest!The prompt to send.

Objects​

InferenceResult · ServiceInfo

InferenceResult​

object

The model's answer to an inference request.

FieldTypeDescription
candidateString!The model's text output, returned as produced. It is a proposal only: nothing has validated it.
modelString!Identifier of the model that answered, as reported by the provider.
providerString!Token of the registered provider that served the call.

ServiceInfo​

object

Identity of the service answering the request.

FieldTypeDescription
areaString!The functional area this service serves; for this service, the AI inference area.

Input types​

InferenceRequest

InferenceRequest​

input

A prompt to send to the model. The output-token limit, the endpoint and the call timeout are fixed by the server and cannot be set by the caller.

Input fieldTypeDescription
promptString!The user prompt. Required, and must not be blank. The prompt and system prompt together may not exceed 128 KiB unless the operator configured a different limit.
systemStringOptional system prompt (instructions or persona) sent ahead of the prompt.