v1

latestOpenAPI 3.0.02026-07-1761823.7 KB

Generate object

Generate a structured object for a specific workflow

post/api/v1/generate/object

Request body

inputstring required

The input text to generate a response for

workflowSlugstring required

The slug of the Workflow to use for generation (can be found in the Itzam dashboard)

groupIdstring

Optional identifier for grouping related runs (e.g. user ID, session ID, etc.)

schemaobject

The schema of the response, JSON Schema

Example request

{
  "input": "Tell me about renewable energy",
  "workflowSlug": "my_great_workflow",
  "groupId": "my-group-id",
  "schema": {
    "title": "My great response",
    "description": "The response to the input",
    "type": "object"
  }
}

Response

Successfully generated object (we also return the run ID in the header X-Run-ID)

{"stackTrail":"components:schemas:GenerateObjectResponse:properties:object","oasType":"schema","type":"unknown","description":"The generated object based on the provided schema","nullable":true}

Example response

{
  "metadata": {
    "runId": "run_1234567890",
    "cost": "0.001",
    "model": {
      "name": "gpt-4o",
      "tag": "openai:gpt-4o"
    },
    "durationInMs": 1000,
    "inputTokens": 1000,
    "outputTokens": 1000
  }
}