Skip to main content
POST
/
v4
/
models
/
{model_instance_id}
/
deployments
/
{model_deployment_id}
/
execute
Python
import os
from scale_gp import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
response = client.models.deployments.execute(
    model_deployment_id="model_deployment_id",
    model_instance_id="model_instance_id",
)
print(response)
package main

import (
"context"
"fmt"

"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)

func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Models.Deployments.Execute(
context.TODO(),
"model_instance_id",
"model_deployment_id",
sgp.ModelDeploymentExecuteParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
curl --request POST \
--url https://api.egp.scale.com/v4/models/{model_instance_id}/deployments/{model_deployment_id}/execute \
--header 'Content-Type: application/json' \
--data '
{
"stream": false
}
'
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({stream: false})
};

fetch('https://api.egp.scale.com/v4/models/{model_instance_id}/deployments/{model_deployment_id}/execute', 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://api.egp.scale.com/v4/models/{model_instance_id}/deployments/{model_deployment_id}/execute",
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([
'stream' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.post("https://api.egp.scale.com/v4/models/{model_instance_id}/deployments/{model_deployment_id}/execute")
.header("Content-Type", "application/json")
.body("{\n \"stream\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.egp.scale.com/v4/models/{model_instance_id}/deployments/{model_deployment_id}/execute")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"stream\": false\n}"

response = http.request(request)
puts response.read_body
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}

Path Parameters

model_instance_id
string
required
model_deployment_id
string
required

Body

application/json
stream
boolean
default:false

Flag indicating whether to stream the completion response

Response

Successful Response