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
)
generic_model_response = client.alias.execute(
alias="alias",
)
print(generic_model_response.error_message)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"),
)
genericModelResponse, err := client.Alias.Execute(
context.TODO(),
"alias",
sgp.AliasExecuteParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", genericModelResponse.ErrorMessage)
}
curl --request POST \
--url https://api.egp.scale.com/v4/serving/a/{alias}/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/serving/a/{alias}/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/serving/a/{alias}/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/serving/a/{alias}/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/serving/a/{alias}/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{
"status": "<string>",
"status_code": 123,
"error_message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Model server
Fixed Server interface for Model execution by named alias
POST
/
v4
/
serving
/
a
/
{alias}
/
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
)
generic_model_response = client.alias.execute(
alias="alias",
)
print(generic_model_response.error_message)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"),
)
genericModelResponse, err := client.Alias.Execute(
context.TODO(),
"alias",
sgp.AliasExecuteParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", genericModelResponse.ErrorMessage)
}
curl --request POST \
--url https://api.egp.scale.com/v4/serving/a/{alias}/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/serving/a/{alias}/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/serving/a/{alias}/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/serving/a/{alias}/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/serving/a/{alias}/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{
"status": "<string>",
"status_code": 123,
"error_message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}⌘I

