v1

latestOpenAPI 3.0.02026-07-1761823.7 KB

Generate text

Generate text for a specific workflow

post/api/v1/generate/text

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.)

Example request

{
  "input": "Tell me about renewable energy",
  "workflowSlug": "my_great_workflow",
  "groupId": "my-group-id"
}

Response

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

textstring required

The generated output text

Example response

{
  "text": "Renewable energy is...",
  "metadata": {
    "runId": "run_1234567890",
    "cost": "0.001",
    "model": {
      "name": "gpt-4o",
      "tag": "openai:gpt-4o"
    },
    "durationInMs": 1000,
    "inputTokens": 1000,
    "outputTokens": 1000
  }
}
All 6 operations