Create Model API
Creates a new Model API with a single Model API version.
curl --request POST \
--url https://mycluster.domino.tech/api/modelServing/v1/modelApis \
--header 'Content-Type: application/json' \
--header 'X-Domino-Api-Key: <api-key>' \
--data '
{
"description": "<string>",
"environmentId": "<string>",
"environmentVariables": [
{
"key": "<string>",
"value": "<string>"
}
],
"isAsync": true,
"name": "<string>",
"strictNodeAntiAffinity": true,
"version": {
"logHttpRequestResponse": true,
"monitoringEnabled": true,
"projectId": "<string>",
"source": {
"excludeFiles": [
"<string>"
],
"file": "<string>",
"function": "<string>",
"registeredModelName": "<string>",
"registeredModelVersion": 123
},
"commitId": "<string>",
"description": "<string>",
"environmentId": "<string>",
"predictionDatasetResourceId": "<string>",
"provenanceCheckpointId": "<string>",
"recordInvocation": true,
"shouldDeploy": true
},
"bundleId": "<string>",
"hardwareTierId": "<string>",
"replicas": 123,
"resourceQuotaId": "<string>"
}
'import requests
url = "https://mycluster.domino.tech/api/modelServing/v1/modelApis"
payload = {
"description": "<string>",
"environmentId": "<string>",
"environmentVariables": [
{
"key": "<string>",
"value": "<string>"
}
],
"isAsync": True,
"name": "<string>",
"strictNodeAntiAffinity": True,
"version": {
"logHttpRequestResponse": True,
"monitoringEnabled": True,
"projectId": "<string>",
"source": {
"excludeFiles": ["<string>"],
"file": "<string>",
"function": "<string>",
"registeredModelName": "<string>",
"registeredModelVersion": 123
},
"commitId": "<string>",
"description": "<string>",
"environmentId": "<string>",
"predictionDatasetResourceId": "<string>",
"provenanceCheckpointId": "<string>",
"recordInvocation": True,
"shouldDeploy": True
},
"bundleId": "<string>",
"hardwareTierId": "<string>",
"replicas": 123,
"resourceQuotaId": "<string>"
}
headers = {
"X-Domino-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Domino-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
environmentId: '<string>',
environmentVariables: [{key: '<string>', value: '<string>'}],
isAsync: true,
name: '<string>',
strictNodeAntiAffinity: true,
version: {
logHttpRequestResponse: true,
monitoringEnabled: true,
projectId: '<string>',
source: {
excludeFiles: ['<string>'],
file: '<string>',
function: '<string>',
registeredModelName: '<string>',
registeredModelVersion: 123
},
commitId: '<string>',
description: '<string>',
environmentId: '<string>',
predictionDatasetResourceId: '<string>',
provenanceCheckpointId: '<string>',
recordInvocation: true,
shouldDeploy: true
},
bundleId: '<string>',
hardwareTierId: '<string>',
replicas: 123,
resourceQuotaId: '<string>'
})
};
fetch('https://mycluster.domino.tech/api/modelServing/v1/modelApis', 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://mycluster.domino.tech/api/modelServing/v1/modelApis",
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([
'description' => '<string>',
'environmentId' => '<string>',
'environmentVariables' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'isAsync' => true,
'name' => '<string>',
'strictNodeAntiAffinity' => true,
'version' => [
'logHttpRequestResponse' => true,
'monitoringEnabled' => true,
'projectId' => '<string>',
'source' => [
'excludeFiles' => [
'<string>'
],
'file' => '<string>',
'function' => '<string>',
'registeredModelName' => '<string>',
'registeredModelVersion' => 123
],
'commitId' => '<string>',
'description' => '<string>',
'environmentId' => '<string>',
'predictionDatasetResourceId' => '<string>',
'provenanceCheckpointId' => '<string>',
'recordInvocation' => true,
'shouldDeploy' => true
],
'bundleId' => '<string>',
'hardwareTierId' => '<string>',
'replicas' => 123,
'resourceQuotaId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Domino-Api-Key: <api-key>"
],
]);
$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://mycluster.domino.tech/api/modelServing/v1/modelApis"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isAsync\": true,\n \"name\": \"<string>\",\n \"strictNodeAntiAffinity\": true,\n \"version\": {\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n },\n \"bundleId\": \"<string>\",\n \"hardwareTierId\": \"<string>\",\n \"replicas\": 123,\n \"resourceQuotaId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Domino-Api-Key", "<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://mycluster.domino.tech/api/modelServing/v1/modelApis")
.header("X-Domino-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isAsync\": true,\n \"name\": \"<string>\",\n \"strictNodeAntiAffinity\": true,\n \"version\": {\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n },\n \"bundleId\": \"<string>\",\n \"hardwareTierId\": \"<string>\",\n \"replicas\": 123,\n \"resourceQuotaId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/api/modelServing/v1/modelApis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Domino-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isAsync\": true,\n \"name\": \"<string>\",\n \"strictNodeAntiAffinity\": true,\n \"version\": {\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n },\n \"bundleId\": \"<string>\",\n \"hardwareTierId\": \"<string>\",\n \"replicas\": 123,\n \"resourceQuotaId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access": {
"accessTokens": [
{
"created": 123,
"createdBy": "<string>",
"id": "<string>",
"lastGenerated": 123,
"lastGeneratedBy": "<string>",
"name": "<string>"
}
],
"isPublic": true
},
"collaborators": [
{
"collaborator": "<string>",
"role": "<string>"
}
],
"description": "<string>",
"environmentId": "<string>",
"healthCheck": {
"failureThreshold": 123,
"initialDelaySeconds": 123,
"periodSeconds": 123,
"timeoutSeconds": 123
},
"id": "<string>",
"isArchived": true,
"isAsync": true,
"metadata": {
"created": 123,
"createdBy": "<string>",
"lastModified": 123
},
"name": "<string>",
"replicas": 123,
"routingMode": "<string>",
"strictNodeAntiAffinity": true,
"volumes": [
{
"mountPath": "<string>",
"name": "<string>",
"readOnly": true,
"volumeType": "<string>"
}
],
"activeVersion": {
"dataPlaneId": "<string>",
"id": "<string>",
"deployment": {
"isPending": true,
"status": "<string>"
},
"number": 123
},
"bundleId": "<string>",
"hardwareTierId": "<string>",
"overrideRequestTimeoutSecs": 123,
"resourceQuotaId": "<string>"
}Authorizations
Body
The description of the Model API to create.
The id of the environment the Model API to create should be deployed to.
The environment variables of the Model API to create.
Show child attributes
Show child attributes
Whether the Model API to create should be async.
The name of the Model API to create.
Whether the Model API to create should have strict node anti affinity.
Show child attributes
Show child attributes
The ID of the bundle governing the model API to create.
^[0-9a-f]{24}$The id of the hardware tier the Model API to create should be deployed with.
The number of replicas of the Model API should be created with.
The id of the resource quota the Model API to create should be deployed with.
Response
The created Model API.
Show child attributes
Show child attributes
The collaborators of the Model API.
Show child attributes
Show child attributes
The description of the Model API.
The id of the environment the Model API is deployed to.
Show child attributes
Show child attributes
The id of the Model API.
Whether the Model API is archived.
Whether the Model API is async.
Show child attributes
Show child attributes
The name of the Model API.
The number of replicas of the Model API.
The routing mode of the Model API.
Whether the Model API has strict node anti affinity.
The volumes of the Model API.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The ID of the bundle governing the model API to create.
^[0-9a-f]{24}$The id of the hardware tier the Model API is deployed with.
The request timeout configuration of the Model API.
The id of the resource quota the Model API is deployed with.
Was this page helpful?
curl --request POST \
--url https://mycluster.domino.tech/api/modelServing/v1/modelApis \
--header 'Content-Type: application/json' \
--header 'X-Domino-Api-Key: <api-key>' \
--data '
{
"description": "<string>",
"environmentId": "<string>",
"environmentVariables": [
{
"key": "<string>",
"value": "<string>"
}
],
"isAsync": true,
"name": "<string>",
"strictNodeAntiAffinity": true,
"version": {
"logHttpRequestResponse": true,
"monitoringEnabled": true,
"projectId": "<string>",
"source": {
"excludeFiles": [
"<string>"
],
"file": "<string>",
"function": "<string>",
"registeredModelName": "<string>",
"registeredModelVersion": 123
},
"commitId": "<string>",
"description": "<string>",
"environmentId": "<string>",
"predictionDatasetResourceId": "<string>",
"provenanceCheckpointId": "<string>",
"recordInvocation": true,
"shouldDeploy": true
},
"bundleId": "<string>",
"hardwareTierId": "<string>",
"replicas": 123,
"resourceQuotaId": "<string>"
}
'import requests
url = "https://mycluster.domino.tech/api/modelServing/v1/modelApis"
payload = {
"description": "<string>",
"environmentId": "<string>",
"environmentVariables": [
{
"key": "<string>",
"value": "<string>"
}
],
"isAsync": True,
"name": "<string>",
"strictNodeAntiAffinity": True,
"version": {
"logHttpRequestResponse": True,
"monitoringEnabled": True,
"projectId": "<string>",
"source": {
"excludeFiles": ["<string>"],
"file": "<string>",
"function": "<string>",
"registeredModelName": "<string>",
"registeredModelVersion": 123
},
"commitId": "<string>",
"description": "<string>",
"environmentId": "<string>",
"predictionDatasetResourceId": "<string>",
"provenanceCheckpointId": "<string>",
"recordInvocation": True,
"shouldDeploy": True
},
"bundleId": "<string>",
"hardwareTierId": "<string>",
"replicas": 123,
"resourceQuotaId": "<string>"
}
headers = {
"X-Domino-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Domino-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
environmentId: '<string>',
environmentVariables: [{key: '<string>', value: '<string>'}],
isAsync: true,
name: '<string>',
strictNodeAntiAffinity: true,
version: {
logHttpRequestResponse: true,
monitoringEnabled: true,
projectId: '<string>',
source: {
excludeFiles: ['<string>'],
file: '<string>',
function: '<string>',
registeredModelName: '<string>',
registeredModelVersion: 123
},
commitId: '<string>',
description: '<string>',
environmentId: '<string>',
predictionDatasetResourceId: '<string>',
provenanceCheckpointId: '<string>',
recordInvocation: true,
shouldDeploy: true
},
bundleId: '<string>',
hardwareTierId: '<string>',
replicas: 123,
resourceQuotaId: '<string>'
})
};
fetch('https://mycluster.domino.tech/api/modelServing/v1/modelApis', 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://mycluster.domino.tech/api/modelServing/v1/modelApis",
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([
'description' => '<string>',
'environmentId' => '<string>',
'environmentVariables' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'isAsync' => true,
'name' => '<string>',
'strictNodeAntiAffinity' => true,
'version' => [
'logHttpRequestResponse' => true,
'monitoringEnabled' => true,
'projectId' => '<string>',
'source' => [
'excludeFiles' => [
'<string>'
],
'file' => '<string>',
'function' => '<string>',
'registeredModelName' => '<string>',
'registeredModelVersion' => 123
],
'commitId' => '<string>',
'description' => '<string>',
'environmentId' => '<string>',
'predictionDatasetResourceId' => '<string>',
'provenanceCheckpointId' => '<string>',
'recordInvocation' => true,
'shouldDeploy' => true
],
'bundleId' => '<string>',
'hardwareTierId' => '<string>',
'replicas' => 123,
'resourceQuotaId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Domino-Api-Key: <api-key>"
],
]);
$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://mycluster.domino.tech/api/modelServing/v1/modelApis"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isAsync\": true,\n \"name\": \"<string>\",\n \"strictNodeAntiAffinity\": true,\n \"version\": {\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n },\n \"bundleId\": \"<string>\",\n \"hardwareTierId\": \"<string>\",\n \"replicas\": 123,\n \"resourceQuotaId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Domino-Api-Key", "<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://mycluster.domino.tech/api/modelServing/v1/modelApis")
.header("X-Domino-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isAsync\": true,\n \"name\": \"<string>\",\n \"strictNodeAntiAffinity\": true,\n \"version\": {\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n },\n \"bundleId\": \"<string>\",\n \"hardwareTierId\": \"<string>\",\n \"replicas\": 123,\n \"resourceQuotaId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/api/modelServing/v1/modelApis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Domino-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isAsync\": true,\n \"name\": \"<string>\",\n \"strictNodeAntiAffinity\": true,\n \"version\": {\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n },\n \"bundleId\": \"<string>\",\n \"hardwareTierId\": \"<string>\",\n \"replicas\": 123,\n \"resourceQuotaId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access": {
"accessTokens": [
{
"created": 123,
"createdBy": "<string>",
"id": "<string>",
"lastGenerated": 123,
"lastGeneratedBy": "<string>",
"name": "<string>"
}
],
"isPublic": true
},
"collaborators": [
{
"collaborator": "<string>",
"role": "<string>"
}
],
"description": "<string>",
"environmentId": "<string>",
"healthCheck": {
"failureThreshold": 123,
"initialDelaySeconds": 123,
"periodSeconds": 123,
"timeoutSeconds": 123
},
"id": "<string>",
"isArchived": true,
"isAsync": true,
"metadata": {
"created": 123,
"createdBy": "<string>",
"lastModified": 123
},
"name": "<string>",
"replicas": 123,
"routingMode": "<string>",
"strictNodeAntiAffinity": true,
"volumes": [
{
"mountPath": "<string>",
"name": "<string>",
"readOnly": true,
"volumeType": "<string>"
}
],
"activeVersion": {
"dataPlaneId": "<string>",
"id": "<string>",
"deployment": {
"isPending": true,
"status": "<string>"
},
"number": 123
},
"bundleId": "<string>",
"hardwareTierId": "<string>",
"overrideRequestTimeoutSecs": 123,
"resourceQuotaId": "<string>"
}