Skip to main content
This page covers the HTTP request format for calling your endpoints.

Request Format

URL Structure

Full example:

Required Headers

Request Body

JSON object matching your endpoint’s input schema:

Complete Request Example

Response Format

Success Response

The response matches your endpoint’s output schema (if defined) or returns the raw LLM output.

Response Headers

Request Options

Specifying a Prompt

By default, requests use the endpoint’s default prompt. To use a specific prompt:
Only Live prompts can be specified via the API. Draft prompts are test-only.

Bypassing Cache

Force a fresh LLM call even if cached:

Input Validation

Requests are validated against your input schema before processing.

Image Inputs

For endpoints with image input fields, send images as base64 data URIs in the JSON body:
Content-Type remains application/json — no multipart form data needed. Images are embedded as base64 data URI strings.

Image Generation Responses

When an endpoint generates images (has image output fields), the response includes a generatedImages array instead of standard JSON output fields:
Decode the base64Data to get the raw image bytes (typically PNG format).

Required Fields

If a required field is missing:

Type Validation

If a field has the wrong type:

Constraint Validation

If a value violates constraints:

Timeouts

Default timeout is 60 seconds. For long-running requests:
  • The connection stays open until the LLM responds
  • Very complex prompts may take 30-60 seconds
  • If timeout is exceeded, you’ll receive a 504 error
Set appropriate timeouts in your HTTP client. For most requests, 30-60 seconds is sufficient.

Idempotency

Endprompt requests are not idempotent by default. Each request:
  • Triggers a new LLM call (unless cached)
  • Is logged separately
  • Consumes tokens from the LLM provider
If you need idempotency, use caching with consistent input data.

Best Practices

Always check for error responses and handle them appropriately.
Configure your HTTP client with appropriate timeout values.
Save the X-Request-Id header for debugging support requests.
Check rate limit headers and implement backoff when approaching limits.

Finding Your Endpoint URL

  1. Open your endpoint in the dashboard
  2. Go to the OpenAPI tab
  3. Your full URL is shown at the top
  4. Code samples are provided in multiple languages

Next Steps

Code Examples

Complete examples in multiple languages

Error Handling

Understand error responses