Skip to content

Agent calls, streams and bulk jobs

A call takes more shapes than one request and reply: another agent's call, a stream, a job over millions of inputs, a large file.

Every shape is one Action

An agent-to-agent call, a stream and a bulk job each answer one Action, priced and kept like any call. Filled: what a caller sees.

Shapes past one request

Each shape below answers one Action, so its states, its price and its record are the ones every call has.

FamilyWhat it does
Agent-to-agent callsAnother agent sends work over the agent-to-agent protocol at /a2a; each call runs as an Action, and the agent card names the Verbs it accepts
The agent card and the offer cardThe agent card carries the offer card whole, with the skills, input schemas and the rung each Verb accepts, so the two never disagree
Streamed outputA generative or agentic Verb with stream: true sends its output as it is written: server-sent events over HTTP, progress over MCP, an iterator in the SDK
ResumeA cut stream resumes from its last event id; the output is kept whole on the Action once the run ends
Bulk jobsOne Verb over a file of inputs, up to the limit the envelope sets: progress, partial results as a file, and a cancel
Bulk pricesEach input priced as one call, Max-Cost caps the whole job, and a miss or a refused row costs nothing
Large filesResumable uploads, piece by piece, links that expire for downloads, and ranges, on any file field
The SDKGenerated in each language sdk.languages names, published under your own registry name with each deploy, typed from the file
SDK releasesSemantic versions: the major is the API's Version, a minor each additive deploy, a patch a docs or type fix, each with its changelog
Agent-to-agent stateThe Action it is
submitted, workingpending, Running
input-requiredpending, with the reason AwaitingInput and what it needs
auth-requiredpending, AwaitingApproval, or a 401 that names the missing rung
completeddone, with its output; each artifact is an output field or a file
canceledcancelled, by Action.cancel on any Interface
failed, rejectedfailed, or refused with its Problem

Example

Summaries stream as they are written, and the SDK ships in three languages under the seller's own name.

definition.ts
13 lines
import { define, generative } from 'apis.dev'

/** Two sentences on what any company sells, written as you watch. */
export default define({
  name: 'summaries', domain: 'summaries.apis.dev',
  Company: {
    domain: 'url!#',
    summarize: generative('Two sentences on what {domain} sells',
      { returns: { summary: 'string' }, stream: true }),
  },
  offer: { 'Company.summarize': 0.02 },
  sdk: { languages: ['typescript', 'python', 'go'], scope: '@summaries' },
})

The reply streams the summary as the model writes it, then the done Action.

Response
HTTP/1.1 200 OK
Content-Type: text/event-stream
X-Cost: price=0.02, currency="USD"
X-Action-Id: act_5
X-Request-Id: req_1c6e0a94d3b28f75e4a2

id: 1
event: output
data: {"summary": "Acme sells industrial sensors"}

id: 2
event: output
data: {"summary": " and the software that reads them."}

id: 3
event: done
data: {"id": "act_5", "status": "done"}

That is POST /companies/acme.com/summarize with Accept: text/event-stream, summarizeCompany over MCP with progress, and an iterator in the SDK.

Calls, jobs and releases, state by state

Each is a Thing the caller reads by Verb, and each move writes its Event.

ThingStatesWhat moves it
An agent-to-agent callThe Action's: pending, then done, failed or cancelledThe run; the calling agent sends input or cancels by the same protocol
A streamopen, sending, then done; or cut, then resumedThe run, and the client's connection; the Action holds the whole output either way
A bulk jobuploaded, checking, running, then done, partial or cancelledEach row is checked, then run; a partial job lists every failed row with its Problem
An uploadstarted, uploading, then stored or expiredEach part; an upload left unfinished expires after a day
An SDK releasebuilt, published, deprecatedEach deploy builds and publishes it; it is deprecated with its Version's sunset, and stays installable

What callers, agents and developers meet

  • Another agent. It reads the agent card, sends work by its own protocol, gets input requests and artifacts back, and cancels like any caller.
  • A person watching. Text that appears as it is written, and the same text kept on the Action.
  • A data team. One job for millions of inputs, its progress, its partial results and one price per row.
  • A developer. The SDK in its own language, under the seller's name, with a version that says what changed.

Every shape a call takes is one Action with one price, so an agent's call, a stream and a job are kept and proved alike.