Authentication
Endpoint
POST https://api.fetchhive.com/v1/prompt/invoke
Before you call this endpoint, create or update a prompt deployment from the prompt editor. See Publishing and Versioning for the UI flow.
Request
Use this request shape:| Field | Type | Required | Description |
|---|---|---|---|
deployment | string | Yes | The prompt deployment name you created for the prompt |
variant | string | Yes | The prompt deployment variant you want to run |
inputs | object | No | Key-value pairs for any prompt variables used by the prompt |
streaming | boolean | No | Whether the response should be streamed |
metadata | object | No | Flat caller-defined metadata for audit and log filtering. This is not used as prompt input. |
metadata must be flat and scalar-only: strings, numbers, booleans, or null. Nested objects and arrays return a validation error before the run starts.
This endpoint does not accept top-level image_urls or document
attachments. If a deployed prompt uses an image URL message part, configure
that image URL in the prompt editor or bind it through an inputs variable in
the prompt content. For runtime image/document attachments, invoke an agent
with POST /v1/agent/invoke.
Basic example
YOUR_API_KEY, YOUR_DEPLOYMENT_NAME, YOUR_VARIANT_NAME, and the inputs object with your real values.
Use metadata for audit fields you want to see or filter in logs, such as customer IDs, plan names, regions, or experiment names. Do not put prompt variables there; prompt variables belong in inputs. See Invoke metadata for examples and log filtering details.
Response
Ifstreaming is true, the API returns a stream of data: events rather than one final JSON object. If the provider fails after the stream has opened, the API sends a final error event before closing the stream.
Streaming response
You can receive different event types during the stream. For example: Reasoning or thinking event:Non-streaming response
Ifstreaming is false, the API returns a single JSON response. Provider execution failures return 502 Bad Gateway with an error message. For example:
Next steps
- Publishing and Versioning
- Run with Python SDK - Invoke a prompt from Python
- Run with Node.js SDK - Invoke a prompt from Node.js
- Run with Ruby SDK - Invoke a prompt from Ruby
- Run with PHP SDK - Invoke a prompt from PHP

