Skip to main content

Endpoint

POST /v1/guard/{api-id}/analyze
Authorization: Bearer {api-key}
Content-Type: application/json

Top-level fields

FieldTypeRequiredDescription
messagesarrayYesOpenAI-format messages. The last user message is what gets analyzed; earlier messages are context.
opticonobjectNoOptional tracing metadata for Opticon.

messages — content shapes

The shape of content depends on the API’s bound InputType:
{
  "role": "user",
  "content": "Please analyze this text."
}
Each Guard API is bound to a single InputType. Sending a mismatched type returns 400 INVALID_INPUT_TYPE.

opticon — tracing metadata

All fields are optional.
FieldTypeDescription
trace_idstringCustom trace ID. If omitted, the server generates a UUID.
session_idstringGroups multiple requests into a single session.
user_idstringEnd-user identifier.
metadataobjectFree-form key/value payload recorded on the trace.
tagsarray[string]Filterable tags.
Credentials stay server-side. You never pass Langfuse public/secret keys in opticon — those are managed server-side by Guardian Bastion. You only pass tracing metadata.

Full example

{
  "messages": [
    { "role": "system", "content": "You are a helpful assistant." },
    { "role": "user",   "content": "Tell me about our HBM4 roadmap." }
  ],
  "opticon": {
    "session_id": "fab-chat-session",
    "user_id": "engineer-park",
    "metadata": { "department": "semiconductor", "environment": "production" },
    "tags": ["fab-analysis", "sensitive"]
  }
}