Skip to main content
POST
/
v1
/
intent
/
generate
Generate Intent
curl --request POST \
  --url https://api.aethercitadel.cloud/v1/intent/generate \
  --header 'Content-Type: application/json' \
  --header 'X-Citadel-Key: <x-citadel-key>' \
  --data '
{
  "user_token": "<string>",
  "ttl": 123
}
'
import requests

url = "https://api.aethercitadel.cloud/v1/intent/generate"

payload = {
"user_token": "<string>",
"ttl": 123
}
headers = {
"X-Citadel-Key": "<x-citadel-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-Citadel-Key': '<x-citadel-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_token: '<string>', ttl: 123})
};

fetch('https://api.aethercitadel.cloud/v1/intent/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aethercitadel.cloud/v1/intent/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_token' => '<string>',
'ttl' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Citadel-Key: <x-citadel-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.aethercitadel.cloud/v1/intent/generate"

payload := strings.NewReader("{\n \"user_token\": \"<string>\",\n \"ttl\": 123\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Citadel-Key", "<x-citadel-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.aethercitadel.cloud/v1/intent/generate")
.header("X-Citadel-Key", "<x-citadel-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_token\": \"<string>\",\n \"ttl\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.aethercitadel.cloud/v1/intent/generate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Citadel-Key"] = '<x-citadel-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_token\": \"<string>\",\n \"ttl\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "intent_hash": "<string>",
  "intent_class": "<string>",
  "expires_at": 123
}

Overview

Generates a User Intent Signature (UIS) — a SHA-256 hash that represents what a user intends to do, without including any PII. Call this before sending a user’s request to your AI service. Attach the returned intent_hash to the AI request via the X-Intent-Hash header.

Request

X-Citadel-Key
string
required
Your Aether Citadel API key (ack_live_...)
user_token
string
required
The user’s JWT from your authentication system. Used to fetch semantic context from AetherDB. The token itself is never stored by Citadel.
ttl
integer
default:"3600"
Time-to-live in seconds for this intent signature. After expiry, verify will return ExpiredIntent. Default: 3600 (1 hour). Max recommended: 86400 (24h).

Response

intent_hash
string
The zero-knowledge intent signature. Format: sha256:<64 hex chars>. Attach this to your AI request as X-Intent-Hash.
intent_class
string
Semantic classification of user intent. One of: commerce, infrastructure, wellness, finance, education, social, other.
expires_at
integer
Unix timestamp when this intent expires. After this time, verification will fail with ExpiredIntent.

Example

curl -X POST https://api.aethercitadel.cloud/v1/intent/generate \
  -H "X-Citadel-Key: ack_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_token": "eyJhbGciOiJIUzI1NiJ9...",
    "ttl": 3600
  }'
const res = await fetch('https://api.aethercitadel.cloud/v1/intent/generate', {
  method: 'POST',
  headers: {
    'X-Citadel-Key': process.env.CITADEL_API_KEY!,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ user_token: userJwt, ttl: 3600 }),
});
const { intent_hash, intent_class, expires_at } = await res.json();
import httpx

resp = httpx.post(
    'https://api.aethercitadel.cloud/v1/intent/generate',
    headers={'X-Citadel-Key': CITADEL_API_KEY},
    json={'user_token': user_jwt, 'ttl': 3600},
)
data = resp.json()
200 Response:
{
  "intent_hash": "sha256:a3f8c2d1e5b9047263a1c4d7e8f2b3a9c6d5e4f1a2b3c4d5e6f7a8b9c0d1e2f3",
  "intent_class": "commerce",
  "expires_at": 1718003600
}

Error Responses

StatusErrorMeaning
400token too shortuser_token is less than 10 characters
400token contains invalid charactersNon-alphanumeric/JWT chars in token
401invalid or missing X-Citadel-KeyBad or missing API key
502AetherDB request failedCould not fetch semantic context

Notes

  • The user_token is sent to AetherDB (within your infrastructure) to extract semantic tags. It is never stored by Citadel.
  • Each call generates a new, unique intent hash — even for the same user.
  • Intent hashes are single-use — do not reuse them across different AI requests.