Pre-Flight API · Reference

Pre-Flight API reference

Two calls. Preflight scopes a raw prompt, scores its risk, and returns it with placeholders for every missing fact. Converge fills those placeholders and returns the finalized prompt, ready to send to your target model. Both calls are recorded against one session ID.

Base URLAuthenticationPOST /preflight POST /convergeEnum valuesRate limitsErrors

Base URL

https://preflight-api.vertixiq.com/v1/preflight-api

JSON in, JSON out. Send Content-Type: application/json. Request bodies are limited to 200 KB.

Authentication

Every request carries an API key as a bearer token:

Authorization: Bearer pfk_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Keys are issued by VertixIQ and tied to a Pre-Flight account. They are stored hashed and cannot be recovered; a lost key is revoked and replaced. Keys are accepted only in the header, never in the request body.

Call 1 · Preflight

POST/v1/preflight-api/preflight

Scopes the prompt, classifies its intent, assigns a risk tier, and marks every missing detail as a numbered placeholder. Issues a new session_id.

Request body

FieldTypeDescription
promptstring, requiredThe raw prompt. 10 to 10,000 characters.
target_modelstring, optionalThe model the prompt will be sent to. Shapes the formatting of scoped_prompt. Default other (generic markdown). See enum values.

Response body · 200

FieldTypeDescription
session_idUUID v4Audit identifier for this prompt. Pass it to Converge. Also returned in the X-Preflight-Session-Id header.
scoped_promptstringThe improved prompt. Each missing detail appears as [x1: LABEL], [x2: LABEL], … The same gap repeated uses the same id.
placeholdersarray{ "id", "label", "example" } per distinct gap, in order of first appearance. example may be null.
intentstringWhat the prompt is trying to accomplish.
risk_tierstringlow, medium, or high: how likely the original prompt was to produce fabricated or unreliable output.
target_model_echostringThe target_model applied.

Example

curl -X POST https://preflight-api.vertixiq.com/v1/preflight-api/preflight \
  -H "Authorization: Bearer $PREFLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Plan a trip to Lisbon for me",
    "target_model": "gpt-5"
  }'
{
  "session_id": "3f9c2a71-5b0e-4c8d-9a61-7e2f4b8d1c05",
  "scoped_prompt": "## Task\nPlan a [x1: NUMBER OF DAYS] trip to Lisbon.\n\n## Constraints\n- Budget: [x2: BUDGET]\n- Flag any opening hours or prices you cannot confirm.",
  "placeholders": [
    { "id": "x1", "label": "number of days", "example": "5-day" },
    { "id": "x2", "label": "budget", "example": "mid-range, $200/day" }
  ],
  "intent": "trip_planning",
  "risk_tier": "low",
  "target_model_echo": "gpt-5"
}

Call 2 · Converge

POST/v1/preflight-api/converge

Fills every placeholder in scoped_prompt with your values and returns the finalized prompt. No model is called; the substitution is exact. The flow is stateless: you send the scoped prompt back. The session_id must come from a successful Preflight call made with the same API key; Converge reads that call's intent and risk_tier from the audit record.

Request body

FieldTypeDescription
session_idUUID, requiredFrom the Preflight response.
scoped_promptstring, requiredThe scoped_prompt from Preflight. Up to 40,000 characters.
placeholder_dataobject, requiredMap of placeholder id to value, e.g. {"x1": "5-day"}. Every id in the prompt needs a non-empty value; ids not in the prompt are rejected. Values up to 2,000 characters.
target_modelstring, optionalEchoed back. Default other.

Response body · 200

FieldTypeDescription
session_idUUIDEchoed.
finalized_promptstringThe prompt with every placeholder filled, ready for the target model.
intentstringFrom the Preflight call.
risk_tierstringFrom the Preflight call.
target_model_echostringThe target_model applied.

Example

curl -X POST https://preflight-api.vertixiq.com/v1/preflight-api/converge \
  -H "Authorization: Bearer $PREFLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": "3f9c2a71-5b0e-4c8d-9a61-7e2f4b8d1c05",
    "scoped_prompt": "## Task\nPlan a [x1: NUMBER OF DAYS] trip to Lisbon.\n\n## Constraints\n- Budget: [x2: BUDGET]\n- Flag any opening hours or prices you cannot confirm.",
    "placeholder_data": { "x1": "5-day", "x2": "mid-range, $200/day" },
    "target_model": "gpt-5"
  }'
{
  "session_id": "3f9c2a71-5b0e-4c8d-9a61-7e2f4b8d1c05",
  "finalized_prompt": "## Task\nPlan a 5-day trip to Lisbon.\n\n## Constraints\n- Budget: mid-range, $200/day\n- Flag any opening hours or prices you cannot confirm.",
  "intent": "trip_planning",
  "risk_tier": "low",
  "target_model_echo": "gpt-5"
}

Enum values

target_model

ValueFormatting applied to scoped_prompt
claude-sonnet-4.7XML-tagged sections (context, task, constraints, output format).
gpt-5Markdown headings with bullet lists.
gemini-pro-2Markdown headings; task first, then context, constraints, output format.
llama-3-70bCompact, flat labelled sections for smaller context windows.
otherGeneric markdown. The default.

target_model controls formatting only. It does not change the model Pre-Flight uses to scope your prompt.

intent

ValueMeaning
trip_planningTravel, itineraries, events, logistics.
code_genWriting, reviewing, or debugging software or queries.
factual_queryLooking up facts, rules, definitions, or how something works.
creative_taskFiction, marketing copy, naming, brainstorming, social posts.
analysisEvaluating data, documents, contracts, markets, options, or risks.
customer_facingContent that will be sent to customers, clients, patients, or the public.
otherNone of the above clearly fits.

risk_tier

ValueMeaning
lowLittle factual exposure; improvements are about focus and structure.
mediumGaps that could lead to generic or partly invented output.
highLikely to produce fabricated facts, citations, figures, or obligations if sent as written.

Rate limits

Limits are per API key and count both endpoints.

Over either limit, the API returns 429 with a Retry-After header in seconds. A rejected request does not count against your quota. Higher limits are available per key.

HTTP/1.1 429 Too Many Requests
Retry-After: 23

{
  "error": "RATE_LIMITED",
  "message": "Per-minute request limit reached for this API key.",
  "limit_type": "per_minute",
  "retry_after_seconds": 23
}

Errors

Errors return { "error": CODE, "message": TEXT }, plus extra fields where noted.

StatuserrorWhen
400INVALID_JSONBody is not a JSON object.
400INVALID_PROMPT_LENGTHprompt outside 10 to 10,000 characters.
400INVALID_INPUTThe prompt was rejected by input screening.
400INVALID_SCOPED_PROMPTscoped_prompt empty or over 40,000 characters.
401INVALID_API_KEYMissing, malformed, unknown, or revoked key.
403ACCOUNT_INACTIVEThe account that owns the key is not active.
404SESSION_NOT_FOUNDsession_id is not a successful Preflight call made with this key.
413BODY_TOO_LARGEBody over 200 KB.
422VALIDATION_ERRORMissing or mistyped field, or unknown target_model. Includes details.
422MISSING_PLACEHOLDERSA placeholder has no value. Includes placeholder_ids.
422UNKNOWN_PLACEHOLDERSplaceholder_data has ids not in the prompt. Includes placeholder_ids.
422PLACEHOLDER_VALUE_TOO_LONGA value is over 2,000 characters. Includes placeholder_ids.
422CONTENT_REFUSEDThe prompt could not be scoped under content policy.
429RATE_LIMITEDSee rate limits.
500PROCESSING_ERRORUnexpected error. Safe to retry.
502UNPARSEABLE_RESPONSE, SCOPING_INCOMPLETE, PROCESSING_ERRORScoping did not complete cleanly. Safe to retry.
503SERVICE_UNAVAILABLEThe scoping engine is temporarily unavailable.
504TIMEOUTScoping took too long. Safe to retry.

Preview. This API is in preview ahead of general availability. Enterprise pricing available on request.