API Reference
Create Request
Enqueue a new inference job for the specified model. Request body must match the model’s PredictionRequest schema.
POST
/
{ownerName}
/
{modelName}
Create Request
curl --request POST \
--url https://queue.modelrunner.run/{ownerName}/{modelName} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "two friends cooking together",
"negative_prompt": "worst quality, low quality, deformed, extra fingers",
"width": 1280,
"height": 1024,
"num_outputs": 1,
"scheduler": "K_EULER",
"num_inference_steps": 4,
"guidance_scale": 0,
"seed": 103,
"disable_safety_checker": "false"
}
'import requests
url = "https://queue.modelrunner.run/{ownerName}/{modelName}"
payload = {
"prompt": "two friends cooking together",
"negative_prompt": "worst quality, low quality, deformed, extra fingers",
"width": 1280,
"height": 1024,
"num_outputs": 1,
"scheduler": "K_EULER",
"num_inference_steps": 4,
"guidance_scale": 0,
"seed": 103,
"disable_safety_checker": "false"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'two friends cooking together',
negative_prompt: 'worst quality, low quality, deformed, extra fingers',
width: 1280,
height: 1024,
num_outputs: 1,
scheduler: 'K_EULER',
num_inference_steps: 4,
guidance_scale: 0,
seed: 103,
disable_safety_checker: 'false'
})
};
fetch('https://queue.modelrunner.run/{ownerName}/{modelName}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://queue.modelrunner.run/{ownerName}/{modelName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'two friends cooking together',
'negative_prompt' => 'worst quality, low quality, deformed, extra fingers',
'width' => 1280,
'height' => 1024,
'num_outputs' => 1,
'scheduler' => 'K_EULER',
'num_inference_steps' => 4,
'guidance_scale' => 0,
'seed' => 103,
'disable_safety_checker' => 'false'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://queue.modelrunner.run/{ownerName}/{modelName}"
payload := strings.NewReader("{\n \"prompt\": \"two friends cooking together\",\n \"negative_prompt\": \"worst quality, low quality, deformed, extra fingers\",\n \"width\": 1280,\n \"height\": 1024,\n \"num_outputs\": 1,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 4,\n \"guidance_scale\": 0,\n \"seed\": 103,\n \"disable_safety_checker\": \"false\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://queue.modelrunner.run/{ownerName}/{modelName}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"two friends cooking together\",\n \"negative_prompt\": \"worst quality, low quality, deformed, extra fingers\",\n \"width\": 1280,\n \"height\": 1024,\n \"num_outputs\": 1,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 4,\n \"guidance_scale\": 0,\n \"seed\": 103,\n \"disable_safety_checker\": \"false\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://queue.modelrunner.run/{ownerName}/{modelName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"two friends cooking together\",\n \"negative_prompt\": \"worst quality, low quality, deformed, extra fingers\",\n \"width\": 1280,\n \"height\": 1024,\n \"num_outputs\": 1,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 4,\n \"guidance_scale\": 0,\n \"seed\": 103,\n \"disable_safety_checker\": \"false\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"response_url": "<string>",
"status_url": "<string>",
"cancel_url": "<string>",
"logs": "<string>",
"metrics": {
"inference_time": 123
},
"queue_position": 123
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": "<unknown>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": "<unknown>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": "<unknown>"
}Authorizations
Use the format: Key modelrunner_key
Path Parameters
Model owner or organization name.
Model alias on ModelRunner.
Body
application/json
Response
Request created
Available options:
IN_QUEUE, IN_PROGRESS, COMPLETED, FAILED, CANCELLED Required string length:
21Show child attributes
Show child attributes
⌘I
Create Request
curl --request POST \
--url https://queue.modelrunner.run/{ownerName}/{modelName} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "two friends cooking together",
"negative_prompt": "worst quality, low quality, deformed, extra fingers",
"width": 1280,
"height": 1024,
"num_outputs": 1,
"scheduler": "K_EULER",
"num_inference_steps": 4,
"guidance_scale": 0,
"seed": 103,
"disable_safety_checker": "false"
}
'import requests
url = "https://queue.modelrunner.run/{ownerName}/{modelName}"
payload = {
"prompt": "two friends cooking together",
"negative_prompt": "worst quality, low quality, deformed, extra fingers",
"width": 1280,
"height": 1024,
"num_outputs": 1,
"scheduler": "K_EULER",
"num_inference_steps": 4,
"guidance_scale": 0,
"seed": 103,
"disable_safety_checker": "false"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'two friends cooking together',
negative_prompt: 'worst quality, low quality, deformed, extra fingers',
width: 1280,
height: 1024,
num_outputs: 1,
scheduler: 'K_EULER',
num_inference_steps: 4,
guidance_scale: 0,
seed: 103,
disable_safety_checker: 'false'
})
};
fetch('https://queue.modelrunner.run/{ownerName}/{modelName}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://queue.modelrunner.run/{ownerName}/{modelName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'two friends cooking together',
'negative_prompt' => 'worst quality, low quality, deformed, extra fingers',
'width' => 1280,
'height' => 1024,
'num_outputs' => 1,
'scheduler' => 'K_EULER',
'num_inference_steps' => 4,
'guidance_scale' => 0,
'seed' => 103,
'disable_safety_checker' => 'false'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://queue.modelrunner.run/{ownerName}/{modelName}"
payload := strings.NewReader("{\n \"prompt\": \"two friends cooking together\",\n \"negative_prompt\": \"worst quality, low quality, deformed, extra fingers\",\n \"width\": 1280,\n \"height\": 1024,\n \"num_outputs\": 1,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 4,\n \"guidance_scale\": 0,\n \"seed\": 103,\n \"disable_safety_checker\": \"false\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://queue.modelrunner.run/{ownerName}/{modelName}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"two friends cooking together\",\n \"negative_prompt\": \"worst quality, low quality, deformed, extra fingers\",\n \"width\": 1280,\n \"height\": 1024,\n \"num_outputs\": 1,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 4,\n \"guidance_scale\": 0,\n \"seed\": 103,\n \"disable_safety_checker\": \"false\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://queue.modelrunner.run/{ownerName}/{modelName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"two friends cooking together\",\n \"negative_prompt\": \"worst quality, low quality, deformed, extra fingers\",\n \"width\": 1280,\n \"height\": 1024,\n \"num_outputs\": 1,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 4,\n \"guidance_scale\": 0,\n \"seed\": 103,\n \"disable_safety_checker\": \"false\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"response_url": "<string>",
"status_url": "<string>",
"cancel_url": "<string>",
"logs": "<string>",
"metrics": {
"inference_time": 123
},
"queue_position": 123
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": "<unknown>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": "<unknown>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": "<unknown>"
}
