Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Code attribution

Share attribution records through POST /v1/agent-events with traces:write. Put the record in a code_attribution observation inside a standard event batch.
The SDK's agentTraceRecordBatch(record) uses the record ID for the session, event, and attempt IDs, sets segment to coding, sets task to code-attribution, and uses the record timestamp for at. sendAgentTraceRecord(options, record) sends this batch to /v1/agent-events.
curl https://app.halfspan.com/v1/agent-events \ -H "Authorization: Bearer $HALFSPAN_API_KEY" \ -H 'Content-Type: application/json' \ --data '{ "version": 1, "session": "ba91ae2d-dcdc-4ea7-8cc4-41ac379d0eb6", "segment": "coding", "events": [{ "id": "ba91ae2d-dcdc-4ea7-8cc4-41ac379d0eb6", "task": "code-attribution", "attempt": "ba91ae2d-dcdc-4ea7-8cc4-41ac379d0eb6", "at": "2026-11-25T15:00:00Z", "observation": { "kind": "code_attribution", "record": { "version": "0.1.0", "id": "ba91ae2d-dcdc-4ea7-8cc4-41ac379d0eb6", "timestamp": "2026-11-25T15:00:00Z", "vcs": {"type": "git", "revision": "abc123"}, "tool": {"name": "my-agent", "version": "1.0"}, "files": [{ "path": "src/checkout.ts", "conversations": [{ "contributor": {"type": "ai", "model_id": "example-model"}, "ranges": [{"start_line": 10, "end_line": 18}] }] }] } } }] }'
HTTP 200 for a new session:
{"inserted":1,"total":1}

Record contract

FieldContract
versionRequired; "0.1" or "0.1.0".
idRequired; UUID string of exactly 36 characters.
timestampRequired; RFC 3339 timestamp, with optional fractional seconds.
filesRequired array of file objects. Each requires string path and array conversations.
vcsOptional object requiring type (git, jj, hg, or svn) and string revision.
toolOptional object with optional string name and version.
metadataOptional object.
Each conversation requires a ranges array. Optional url must be an absolute URI. Optional related entries require string type and absolute-URI url. Each range requires positive integer start_line and end_line, and may include string content_hash.
Conversations and ranges may include a contributor object. Its required type is human, ai, mixed, or unknown; optional string model_id is limited to 250 Unicode characters. Extension fields inside the record are preserved. The enclosing batch, event, and observation still reject unknown fields.
The entire request must fit within 262,144 bytes. Replay the identical record and envelope to avoid duplicates. Changing an existing event's content under the same ID returns 409; use a new record ID for a new attribution record.
Agent Trace attribution format: agent-trace.dev, licensed under CC BY 4.0.