Skip to navigation

Create an agent run

Start a Spyglass agent run. The run id is the chat thread id. Pass outputSchema to get that JSON on structured when the run completes. The root type must be "object". Each property can be a string, number, integer, boolean, array, or object. model is default or pro. Poll GET /agent/runs/{id} until status is completed or failed.

Limited to 20 requests per minute per user. The create call is free. The run is billed from model usage when it finishes.

Authentication

AuthorizationBearer

An API key from Settings → API, prefixed sg_live_.

Request

This endpoint expects an object.
querystringRequired1-8000 characters
outputSchemaobjectOptional

JSON Schema for structured. The root type must be "object". Each property can be a string, number, integer, boolean, array, or object.

systemPromptstringOptional1-8000 characters
effortenumOptionalDefaults to medium
modelenumOptionalDefaults to default
Allowed values:

Response

The queued run.
idstring
statusenum
Allowed values:
createdAtdatetime

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
405
Method Not Allowed Error
429
Too Many Requests Error
500
Internal Server Error