Agent Execution Queue#
This template shows the current authenticated API path end to end: create an agent, queue an execution request, and poll the resulting job envelope until it completes.
What Problem It Solves#
Use this template when you need to answer four basic integration questions quickly:
- Can I authenticate against
vex-apias it exists today? - What JSON do I send to create an agent?
- What comes back when I queue an execution?
- What does the completed job envelope look like when I poll it?
Uses#
- API
Prerequisites#
- A running
vex-apiinstance - The public base URL for that instance
- The
VEX_JWT_SECRETused by that instance - Node.js 18+ or any other way to sign an HS256 JWT
POST /api/v1/agents, POST /api/v1/agents/{id}/execute, and GET /api/v1/jobs/{id} all require a bearer JWT. There is no token-mint endpoint today, so evaluators need to sign a token locally from the same VEX_JWT_SECRET.
Step 1: Confirm the Service Is Up#
Expected response shape:
Step 2: Mint an Integration JWT#
Download the zero-dependency helper script:
Run it with the same secret configured on the service:
Expected output:
Save that value as TOKEN in your shell for the next steps.
Step 3: Create an Agent#
Download the request body:
Exact request body:
Request:
Expected response shape:
Artifact produced:
- A persisted agent record with a stable UUID
Step 4: Queue an Execution#
Download the request body:
Exact request body:
Request:
Expected response shape:
Artifact produced:
- A queued execution job
How to inspect it:
- Extract the UUID from the
responsestring and use it as the job ID in the next step
Step 5: Poll the Job#
Request:
Expected response shape:
Artifact produced:
- A completed
AgentJobResultobject inside theresultfield
How to verify or inspect the result:
- Check
statusfirst. A successful run should move frompendingorrunningtocompleted. - Inspect
result.success,result.response,result.tokens_used, andresult.completed_at. - If the run fails, inspect
errorandresult.error.
Current Limitations#
- The JWT bootstrap is external. There is no built-in token issuance endpoint for integrators.
- The execution acknowledgement embeds the job ID inside
responseinstead of returningjob_idas a top-level field. - The queue acknowledgement returns
verified: falseandcontext_hash: "pending"because it is a submission response, not a final proof receipt. max_depthabove10is rejected at agent creation time.