POST
/
v4
/
serving
import SGPClient from 'sgp';

const client = new SGPClient({
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const modelServerInfo = await client.modelServers.create({
    model_deployment_id: 'model_deployment_id',
    name: 'name',
  });

  console.log(modelServerInfo.account_id);
}

main();
{
  "name": "<string>",
  "model_server_id": "<string>",
  "model_deployment_id": "<string>",
  "account_id": "<string>",
  "alias": "<string>"
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Body

application/json

Create a new model server with an initial backend configuration.

Args: name (str): The name of the model server. Only used for display purposes. model_deployment_id (str): The ID of the model deployment to use as the initial backend. alias (str, optional): An alias for the model server. Defaults to None. If configured the model server can be accessed via the alias instead of the model server ID. i.e /models/server/alias/{alias}/execute

name
string
required
model_deployment_id
string
required
alias
string

Response

200
application/json
Successful Response

Model server information. name: The name of the model server. Only used for display purposes. model_server_id: The ID of the model server. model_deployment_id: The ID of the model deployment being used as the backend. account_id: The ID of the account that owns the model server. alias: An alias for the model server. If configured the model server can be accessed via the alias instead of the model server ID. i.e /models/server/alias/{alias}/execute

name
string
required
model_server_id
string
required
model_deployment_id
string
required
account_id
string
required
alias
string