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.application_variants.process(
application_variant_id="application_variant_id",
inputs={
"foo": "bar"
},
)
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.ApplicationVariants.Process(
context.TODO(),
"application_variant_id",
sgp.ApplicationVariantProcessParams{
Inputs: sgp.F(map[string]interface{}{
"foo": "bar",
}),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}curl --request POST \
--url https://api.egp.scale.com/v4/applications/{application_variant_id}/process \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"inputs": {},
"history": [],
"overrides": {
"concurrent": false,
"use_channels": false,
"partial_trace": [
{
"workflow_id": "<string>",
"node_id": "<string>",
"operation_type": "<string>",
"start_timestamp": "<string>",
"operation_input": "<string>",
"operation_output": "<string>",
"duration_ms": 123,
"operation_metadata": {}
}
],
"return_span": true
},
"stream": false,
"operation_metadata": {}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inputs: {},
history: [],
overrides: {
concurrent: false,
use_channels: false,
partial_trace: [
{
workflow_id: '<string>',
node_id: '<string>',
operation_type: '<string>',
start_timestamp: '<string>',
operation_input: '<string>',
operation_output: '<string>',
duration_ms: 123,
operation_metadata: {}
}
],
return_span: true
},
stream: false,
operation_metadata: {}
})
};
fetch('https://api.egp.scale.com/v4/applications/{application_variant_id}/process', 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/applications/{application_variant_id}/process",
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([
'inputs' => [
],
'history' => [
],
'overrides' => [
'concurrent' => false,
'use_channels' => false,
'partial_trace' => [
[
'workflow_id' => '<string>',
'node_id' => '<string>',
'operation_type' => '<string>',
'start_timestamp' => '<string>',
'operation_input' => '<string>',
'operation_output' => '<string>',
'duration_ms' => 123,
'operation_metadata' => [
]
]
],
'return_span' => true
],
'stream' => false,
'operation_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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/applications/{application_variant_id}/process")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {},\n \"history\": [],\n \"overrides\": {\n \"concurrent\": false,\n \"use_channels\": false,\n \"partial_trace\": [\n {\n \"workflow_id\": \"<string>\",\n \"node_id\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"operation_input\": \"<string>\",\n \"operation_output\": \"<string>\",\n \"duration_ms\": 123,\n \"operation_metadata\": {}\n }\n ],\n \"return_span\": true\n },\n \"stream\": false,\n \"operation_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/applications/{application_variant_id}/process")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {},\n \"history\": [],\n \"overrides\": {\n \"concurrent\": false,\n \"use_channels\": false,\n \"partial_trace\": [\n {\n \"workflow_id\": \"<string>\",\n \"node_id\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"operation_input\": \"<string>\",\n \"operation_output\": \"<string>\",\n \"duration_ms\": 123,\n \"operation_metadata\": {}\n }\n ],\n \"return_span\": true\n },\n \"stream\": false,\n \"operation_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"message": "<string>",
"sgp_error_code": "APPLICATION_PROCESSING_ERROR",
"detail": "<string>"
}Applications
Process Application By Id
POST
/
v4
/
applications
/
{application_variant_id}
/
process
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.application_variants.process(
application_variant_id="application_variant_id",
inputs={
"foo": "bar"
},
)
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.ApplicationVariants.Process(
context.TODO(),
"application_variant_id",
sgp.ApplicationVariantProcessParams{
Inputs: sgp.F(map[string]interface{}{
"foo": "bar",
}),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}curl --request POST \
--url https://api.egp.scale.com/v4/applications/{application_variant_id}/process \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"inputs": {},
"history": [],
"overrides": {
"concurrent": false,
"use_channels": false,
"partial_trace": [
{
"workflow_id": "<string>",
"node_id": "<string>",
"operation_type": "<string>",
"start_timestamp": "<string>",
"operation_input": "<string>",
"operation_output": "<string>",
"duration_ms": 123,
"operation_metadata": {}
}
],
"return_span": true
},
"stream": false,
"operation_metadata": {}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inputs: {},
history: [],
overrides: {
concurrent: false,
use_channels: false,
partial_trace: [
{
workflow_id: '<string>',
node_id: '<string>',
operation_type: '<string>',
start_timestamp: '<string>',
operation_input: '<string>',
operation_output: '<string>',
duration_ms: 123,
operation_metadata: {}
}
],
return_span: true
},
stream: false,
operation_metadata: {}
})
};
fetch('https://api.egp.scale.com/v4/applications/{application_variant_id}/process', 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/applications/{application_variant_id}/process",
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([
'inputs' => [
],
'history' => [
],
'overrides' => [
'concurrent' => false,
'use_channels' => false,
'partial_trace' => [
[
'workflow_id' => '<string>',
'node_id' => '<string>',
'operation_type' => '<string>',
'start_timestamp' => '<string>',
'operation_input' => '<string>',
'operation_output' => '<string>',
'duration_ms' => 123,
'operation_metadata' => [
]
]
],
'return_span' => true
],
'stream' => false,
'operation_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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/applications/{application_variant_id}/process")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {},\n \"history\": [],\n \"overrides\": {\n \"concurrent\": false,\n \"use_channels\": false,\n \"partial_trace\": [\n {\n \"workflow_id\": \"<string>\",\n \"node_id\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"operation_input\": \"<string>\",\n \"operation_output\": \"<string>\",\n \"duration_ms\": 123,\n \"operation_metadata\": {}\n }\n ],\n \"return_span\": true\n },\n \"stream\": false,\n \"operation_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/applications/{application_variant_id}/process")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {},\n \"history\": [],\n \"overrides\": {\n \"concurrent\": false,\n \"use_channels\": false,\n \"partial_trace\": [\n {\n \"workflow_id\": \"<string>\",\n \"node_id\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"operation_input\": \"<string>\",\n \"operation_output\": \"<string>\",\n \"duration_ms\": 123,\n \"operation_metadata\": {}\n }\n ],\n \"return_span\": true\n },\n \"stream\": false,\n \"operation_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"message": "<string>",
"sgp_error_code": "APPLICATION_PROCESSING_ERROR",
"detail": "<string>"
}Authorizations
Path Parameters
Body
application/json
Input data for the application. For agents service variants, you must provide inputs as a mapping from {input_name: input_value}. For V0 variants, you must specify the node your input should be passed to, structuring your input as {node_id: {input_name: input_value}}.
History of the application
Show child attributes
Show child attributes
Execution override options for agentic applications
- AgenticApplicationOverrides
- Overrides
Show child attributes
Show child attributes
Control to have streaming of the endpoint. If the last node before the output is a completion node, you can set this to true to get the output as soon as the completion node has a token
Arbitrary user-defined metadata that can be attached to the process operations and will be registered in the interaction.
Response
Successful Response
⌘I

