Skip to main content
After deploying your Flash app with flash deploy, you can call your endpoints directly via HTTP. The request format depends on whether you’re using queue-based or load-balanced configurations.

Authentication

All deployed endpoints require authentication with your Runpod API key:
Your endpoint URLs are displayed after running flash deploy. You can also view them with flash env get <environment-name>.

Queue-based endpoints

Queue-based endpoints (using @Endpoint(name=..., gpu=...) decorator) provide two routes for job submission: /run (asynchronous) and /runsync (synchronous).

Asynchronous calls (/run)

Submit a job and receive a job ID for later status checking:
Response:
Check job status and retrieve results:
When the job completes:

Synchronous calls (/runsync)

Wait for job completion and receive results directly (with timeout):
Response (after job completes):
The /runsync endpoint has a 60-second client-side timeout by default. If you’ve configured execution_timeout_ms on your endpoint, the client timeout uses that value instead. For jobs that take longer than 60 seconds, set execution_timeout_ms to prevent /runsync requests from timing out.
Use /run for long-running jobs that you’ll check later. Use /runsync for quick jobs where you want immediate results (with timeout protection).

Queue-based request format

Queue-based endpoints expect input wrapped in an {"input": {...}} object:
The structure inside "input" depends on your @Endpoint function signature.

Job status states

StatusDescription
IN_QUEUEWaiting for an available worker
IN_PROGRESSWorker is executing your function
COMPLETEDFunction finished successfully
FAILEDExecution encountered an error

Load-balanced endpoints

Load-balanced endpoints (using api = Endpoint(...); @api.post("/path") pattern) provide custom HTTP routes with direct request/response patterns.

Calling load-balanced routes

All routes share the same base URL. Append the route path to call specific functions:

Load-balanced request format

Load-balanced endpoints accept direct JSON payloads (no {"input": {...}} wrapper):
The payload structure depends on your function signature. Each route can accept different parameters.

Multiple routes, single endpoint

A single load-balanced endpoint can serve multiple routes:

Quick reference

Endpoint TypeRoutesRequest FormatResponse
Queue-based/run, /runsync, /status/{id}{"input": {...}}Job ID (async) or result (sync)
Load-balancedCustom paths (e.g., /process)Direct JSON payloadDirect response

Response status codes

CodeMeaning
200Success (load-balanced) or job accepted (queue-based)
400Bad request (invalid input format)
401Unauthorized (invalid or missing API key)
404Route not found
500Internal server error

Error handling

Queue-based errors appear in the job output:
Load-balanced errors return HTTP error codes with JSON body:

Using SDKs

For programmatic access, use the Runpod Python SDK:
See the Runpod SDK documentation for complete SDK usage.

Next steps

Deploy apps

Deploy your Flash app to get endpoint URLs.

Configuration reference

View all endpoint configuration parameters.

Runpod SDK

Use the Python SDK for programmatic access.