TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/vercel/eve/llms.txt
Use this file to discover all available pages before exploring further.
eve/client package is the typed TypeScript client for eve’s default HTTP API. Use it from scripts, server-to-server integrations, tests, evals, backend jobs, or custom UIs that want the session protocol without hand-writing the POST and NDJSON stream loop.
For browser chat UIs, start with useEveAgent. For wire-level details, read the Sessions, runs & streaming reference. The client sits between those two: lower level than the frontend hooks, higher level than raw HTTP.
Create a client
AClient binds one host, auth policy, header policy, and stream reconnection budget:
host is the origin where the eve routes are mounted. In a same-origin browser integration this is often ""; scripts and backend services name the full URL.
Check health and inspect
Usehealth() when a script needs to fail early before creating a session:
ClientError, which carries the HTTP status and response body.
Use info() to inspect a development agent. The client parses and validates the complete response before returning it:
Authentication
Passauth when the eve channel route requires credentials. Bearer values and Basic auth passwords can be strings or async functions — functions run before every HTTP call, including stream reconnects:
headers for route-specific credentials such as bypass tokens or tenant hints:
Create a session
Create aClientSession for each conversation:
sessionId, continuationToken, and stream cursor independently:
Send a message
Pass a string tosend() for plain text:
response.result() consumes the event stream and returns a MessageResult:
| Field | Meaning |
|---|---|
message | Final assistant text for the turn, when one completed. |
status | "waiting", "completed", or "failed". |
events | All stream events observed during the turn. |
sessionId | Session ID for streaming and inspection. |
data | Structured output when the turn requested an output schema. |
session.failed, the turn returns status: "failed" rather than throwing. Transport and route errors throw ClientError.
Send a full turn payload
Usesend() with an object when you need more than plain text — clientContext, attachments, or HITL responses:
clientContext is one-turn ephemeral context for the next model call. It isn’t persisted to durable session history and doesn’t dispatch a turn by itself.
Send file attachments
send() accepts AI SDK UserContent, so a message can mix text and file parts. For local files, read the bytes and build a base64 data: URL:
Stream events live
Usefor await...of when you want to render progress as the model replies:
message.appended and reasoning.appended are incremental delta events. Their completed forms are the compatibility path for clients that don’t render deltas.
MessageResponse is single-use — either aggregate it with result() or iterate it with for await...of. Don’t do both on the same response.Handle event types
Import event types fromeve/client for exhaustiveness or helpers:
| Event | Use |
|---|---|
message.received | Confirm the user message landed. |
reasoning.appended | Render reasoning deltas when the model provides them. |
message.appended | Render assistant text deltas. |
actions.requested | Show tool calls requested by the model. |
action.result | Show tool call results. |
input.requested | Pause the UI for approval or a question answer. |
result.completed | Read structured output from an output schema. |
session.waiting | Enable the composer for the next turn. |
session.completed | Mark the conversation terminal. |
session.failed | Mark the conversation failed. |
Answer human input requests
Tools can pause for approval or ask the user a question. The stream emitsinput.requested with one or more requests. Reply through the same session with inputResponses:
message, inputResponses, and clientContext together when the resumed turn needs both a human answer and follow-up text.
Attach to an existing stream
Usesession.stream() when you already have a session cursor and only need to attach to the existing stream without sending a new turn:
startIndex to override the stored cursor position:
stream() throws if the session has no sessionId, because there’s no stream to attach to before the first send.
Abort a request
Pass anAbortSignal to cancel the POST or stream. Arm the timeout before awaiting send() so it covers both:
send() for the next turn — don’t reuse the same MessageResponse.
Reconnection
The client reconnects after transient stream disconnects, resuming from the number of events already consumed:maxReconnectAttempts is per turn. The default is 3.
Per-request headers
Attach headers to an individual turn rather than every request on the client:What to read next
Frontend Integration
Browser chat UIs with useEveAgent for React, Vue, and Svelte
Evals
Drive the agent through sessions and assert on results
Channels
The HTTP API this client calls
Deployment
Deploy your agent so the client can reach it