Overview
The Artifacts API provides secure access to research outputs (figures, datasets, analysis results) generated during Deep Research conversations. All artifacts are downloaded via presigned URLs with automatic ownership validation.Authentication
All endpoints require authentication via one of:- JWT token in
Authorizationheader - API key in
X-API-Keyheader - x402/b402 payment proof
Security
- Ownership validation: Users can only access their own artifacts
- Path traversal protection: Blocks
../,./, and\in paths - Time-limited URLs: Presigned URLs expire after 1 hour
- Unguessable paths: Artifacts are stored in UUID-based directories
Endpoints
Download Artifact
Generate a presigned download URL for an artifact
User ID who owns the artifact (must match authenticated user)
Conversation state ID containing the artifact
Relative path to the artifact (e.g.,
figures/plot.png)Common Artifact Paths
Artifacts are organized by type within each conversation:Analysis Outputs
figures/*.png- Generated plots and visualizationsfigures/*.jpg- Image outputsresults/*.csv- Processed datasetsresults/*.json- Structured analysis results
Paper Generation
papers/*/paper.pdf- Generated research paperspapers/*/main.tex- LaTeX source filespapers/*/figures/*- Paper figures
Raw Data
uploads/*.csv- User-uploaded datasetsuploads/*.pdf- User-uploaded documents
Usage Example
Error Responses
400 Bad Request - Missing Parameters
400 Bad Request - Path Traversal Attempt
403 Forbidden - Ownership Violation
userId parameter doesn’t match the authenticated user ID.
404 Not Found
500 Internal Server Error
503 Service Unavailable
Best Practices
1. Cache Artifact Metadata
Artifact paths are returned in Deep Research responses. Cache them to avoid unnecessary lookups:2. Handle Expiration
Presigned URLs expire after 1 hour. Request new URLs if downloads fail:3. Validate Paths Client-Side
Prevent path traversal attempts before making requests:Integration with Deep Research
Artifacts are generated during Deep Research cycles:- Start research:
POST /api/deep-research/start - Poll status:
GET /api/deep-research/status/:messageId - Extract artifact paths from the response
filesarray - Download artifacts: Use this API to get presigned URLs
Storage Structure
Artifacts are stored in S3 with the following hierarchy:path parameter is relative to the state directory:
- ✅
figures/plot1.png - ✅
results/analysis.csv - ❌
../other-state/results/data.csv(blocked) - ❌
../../other-user/files.csv(blocked)