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.
| Endpoint | https://<your-host>/api/ai-inference/graphql |
| Auth plane | service — 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 with | service token |
| Schema file | /schema/ai-inference.graphql |
| Described | 12 of 12 elements |
| Note | Called by event-processing under its own service token when compiling a natural-language rule description. Not reachable with a tenant access token. |
Queries
aiInferenceInfo
Identifies the service answering. Requires no specific authority.
Returns ServiceInfo!
Mutations
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!
| Argument | Type | Description |
|---|---|---|
request | InferenceRequest! | The prompt to send. |
Objects
InferenceResult
object
The model's answer to an inference request.
| Field | Type | Description |
|---|---|---|
candidate | String! | The model's text output, returned as produced. It is a proposal only: nothing has validated it. |
model | String! | Identifier of the model that answered, as reported by the provider. |
provider | String! | Token of the registered provider that served the call. |
ServiceInfo
object
Identity of the service answering the request.
| Field | Type | Description |
|---|---|---|
area | String! | The functional area this service serves; for this service, the AI inference area. |
Input types
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 field | Type | Description |
|---|---|---|
prompt | String! | 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. |
system | String | Optional system prompt (instructions or persona) sent ahead of the prompt. |