Skip to content
Console

Run an AI feature

POST
/api/v1/ai/features/{feature_id}/execute
curl --request POST \
--url https://api.inside.chat/api/v1/ai/features/example/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--data '{ "expected_version": 1, "context": { "type": "text", "text": "example", "default_language": "example" } }'

Required scopes: ai_features_read, ai_execute
Data access: –
MCP tool: ai_feature_execute
Note: Write
Note: Idempotency-Key required

Execute a version-bound AI feature using only a supplied typed text context and an unrestricted installation policy. Currently supports configured Lingua.NET language detection only. No live conversation, operator, AI session, provider or configured function is invoked. Read native feature metadata for current adapter availability. Results are retained for 24 hours. A permanent content-free tombstone prevents the same key from creating a new effect after result expiry. Reuse the same key and identical input when retrying. Changed input or policy/revisions conflict. Current policy is checked before result reuse. An unknown outcome returns 409 outcome_unknown; never retry with a new key automatically.

feature_id
required
string
/^aif_[0-9]{1,20}_[1-9][0-9]{0,18}_[1-9][0-9]{0,18}$/
website_id
string
/^web_[0-9]{1,20}_[1-9][0-9]{0,18}$/

Optional; if present must match the resource owner.

Idempotency-Key
required
string
>= 1 characters <= 128 characters /^[!-~]+$/

A stable key for this intended effect. Reuse the same key and input for retries; never automatically replace it after an unknown outcome.

Media typeapplication/json
object
expected_version
required
integer
>= 1 <= 2147483647
context
required
object
type
required
string
Allowed values: text
text
required
string
>= 1 characters <= 4000 characters
default_language
string
>= 2 characters <= 2 characters /^[a-z]{2}$/

Authorized result. Projection depends on current scopes and data policy.

Media typeapplication/json

The result of running offline language detection on the supplied text.

object
data
required
object
feature_id
required
string
/^aif_[0-9]{1,20}_[1-9][0-9]{0,18}_[1-9][0-9]{0,18}$/
version
required
integer
>= 1
type
required
Allowed value: language_detection
output
required
object
language
required
Any of:

Two-letter language code, or null when undetermined.

string
/^[a-z]{2}$/

Example

{
"data": {
"type": "language_detection"
}
}
X-Gateway-Operation-Id
string
/^op_[a-f0-9]{64}$/

Retained command receipt identifier when command reservation was acknowledged; use operation_get with the original credential and website. Not proof of native success or delivery.

Invalid, duplicate or unsupported request parameters.

Missing, expired or revoked installation credential.

Resource not found or not permitted by current authority.

Idempotency_conflict: the key has different input or authority revisions; operation_in_progress: the same command is pending; operation_conflict: native business state rejects the change; outcome_unknown: the native result is uncertain or no longer retained. Keep the same key and input for retries; never automatically create a new key or resubmit the effect.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
Allowed value: 409
code
required
string
Allowed values: idempotency_conflict operation_in_progress operation_conflict outcome_unknown
request_id
required
string

Example

{
"status": 409,
"code": "idempotency_conflict"
}
X-Gateway-Operation-Id
string
/^op_[a-f0-9]{64}$/

Retained command receipt identifier when command reservation was acknowledged; use operation_get with the original credential and website. Not proof of native success or delivery.

The requested capability is not available for application installations.

Per-app quota exceeded.

Retry-After
integer
>= 1

Enrollment, native service or required authority is unavailable.