Intent API
Structured AI actions via a single REST endpoint — no prompt engineering, no model wrangling.
The Intent API is how you invoke LiyaEngine. Pass a domain, an intent key, and your input — get back a validated, structured response. No raw prompts, no system-message wrangling, no parsing free-text output.
Call an intent
POST https://api.liyaengine.ai/v1/run
X-API-Key: liya_prod_...
Content-Type: application/json
{
"domain": "your-domain",
"intent": "your-custom-intent",
"input": { ... }
}An equivalent path-based form is also available: POST /v1/{domain}/{intent} with just { "input": {...} } in the body.
Response:
{
"success": true,
"data": {
"output": { ... },
"session_id": "ses_abc",
"message_id": "msg_xyz"
},
"metadata": {
"intent": "your-custom-intent",
"domain": "your-domain",
"model_used": "claude-sonnet-5",
"tokens_used": 1240,
"cost_usd": 0.00062,
"latency_ms": 340,
"cached": false
}
}What makes it different
Intent-native
Call an intent by name — the engine knows the tools to invoke and the schema to validate against.
Structured by default
Every response conforms to your intent's output schema. No parsing, no hallucinated field names.
Domain-scoped
Field names, valid values, and guardrail policies are loaded from your domain config automatically.
Observable
Every call returns a trace: intent resolved, tools invoked, guardrails checked, latency per step.
Intent structure
An intent is a named, schema-bound AI action. It has:
- Input contract — what fields you must and may pass
- Output contract — what fields you always get back
- Tool set — functions the engine can invoke (see Agent Orchestration)
- Guardrail policies — safety and compliance checks applied (see Guardrails)
You define all of this once, when creating a custom domain — the engine enforces it on every call after that.
Related
Agent Orchestration
Multi-step execution, tools, and retry
Versioning
Every intent change saved and restorable
Example domain walkthrough
A fully worked domain with 17 intents
What's next?
- Use Quickstart to make a real request.
- Use Custom Domain Walkthrough to create your own intent.
- Use Dashboard API when you need to manage domains, keys, sessions, and usage programmatically.