curl --request PUT \
--url https://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse} \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"client_library": "<string>",
"api_url": "<string>",
"api_key": "<string>",
"features": {},
"input_media": {},
"output_media": {},
"max_input_tokens": 123,
"max_output_tokens": 123,
"reasoning_effort": "<string>",
"extended_context": true,
"picture_url": "<string>"
}
'import requests
url = "https://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}"
payload = {
"name": "<string>",
"description": "<string>",
"client_library": "<string>",
"api_url": "<string>",
"api_key": "<string>",
"features": {},
"input_media": {},
"output_media": {},
"max_input_tokens": 123,
"max_output_tokens": 123,
"reasoning_effort": "<string>",
"extended_context": True,
"picture_url": "<string>"
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
client_library: '<string>',
api_url: '<string>',
api_key: '<string>',
features: {},
input_media: {},
output_media: {},
max_input_tokens: 123,
max_output_tokens: 123,
reasoning_effort: '<string>',
extended_context: true,
picture_url: '<string>'
})
};
fetch('https://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}', 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://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'client_library' => '<string>',
'api_url' => '<string>',
'api_key' => '<string>',
'features' => [
],
'input_media' => [
],
'output_media' => [
],
'max_input_tokens' => 123,
'max_output_tokens' => 123,
'reasoning_effort' => '<string>',
'extended_context' => true,
'picture_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <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://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"client_library\": \"<string>\",\n \"api_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"features\": {},\n \"input_media\": {},\n \"output_media\": {},\n \"max_input_tokens\": 123,\n \"max_output_tokens\": 123,\n \"reasoning_effort\": \"<string>\",\n \"extended_context\": true,\n \"picture_url\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-access-token", "<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.put("https://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"client_library\": \"<string>\",\n \"api_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"features\": {},\n \"input_media\": {},\n \"output_media\": {},\n \"max_input_tokens\": 123,\n \"max_output_tokens\": 123,\n \"reasoning_effort\": \"<string>\",\n \"extended_context\": true,\n \"picture_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"client_library\": \"<string>\",\n \"api_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"features\": {},\n \"input_media\": {},\n \"output_media\": {},\n \"max_input_tokens\": 123,\n \"max_output_tokens\": 123,\n \"reasoning_effort\": \"<string>\",\n \"extended_context\": true,\n \"picture_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"model": {
"modelUse": "conversationModel",
"name": "<string>",
"description": "<string>",
"api_url": "<string>",
"endpointHost": "<string>",
"client_library": "<string>",
"features": {},
"input_media": {},
"output_media": {},
"max_input_tokens": 123,
"max_output_tokens": 123,
"reasoning_effort": "<string>",
"extended_context": true,
"picture_url": "<string>",
"status": "active",
"hasApiKey": true,
"awsPair": true,
"updatedAt": "2023-11-07T05:31:56Z"
}
}Create or change the account's custom AI model of one model type
Only the fields sent are changed. A new model needs a name, a key and an endpoint, and is off; an anthropic_cli model needs no endpoint. A google_cli model needs none either. A bedrock_cli model has no endpoint and no key: a body that sends api_url or api_key for it is refused, and a model switched to bedrock_cli keeps neither (its stored key is deleted). A new bedrock_cli model, a switch to bedrock_cli, and every save after which a bedrock_cli model is on need the account’s AWS key pair (an access key id and a secret access key); a save that leaves an existing bedrock_cli model off does not. The Client Library Type must be one offered for the model type; left out, the stored one is kept, or the first offered one for a new model. The endpoint is an https address with a public host name. For anthropic_cli the endpoint may be left empty: the model is then called at Anthropic’s own address (https://api.anthropic.com), and emptying an endpoint or setting one counts as another endpoint. An anthropic_cli endpoint whose path ends in /v1 is refused (a model switched off is not refused for it): type the base address, the requests add /v1/messages themselves. For google_cli the endpoint may be left empty too: the model is then called at Google’s own address (https://generativelanguage.googleapis.com). A google_cli endpoint whose path ends in /v1, /v1beta or /v1alpha is refused (a model switched off is not refused for it): type the base address, the requests add /v1beta/models/… themselves. The key is stored encrypted and never returned; an empty api_key keeps the stored key, and another endpoint or another Client Library Type needs the key again (the stored key is only sent to the destination it was saved with). Setting status to active switches the model on for every Digital Twin of the account: one test request is sent first, and nothing is saved if it fails. The test request depends on the model type: a short completion for Conversation, Document Summarization, Knowledge Generation and Knowledge Generation Fallback; for Image Analysis a picture, whose colour the model must say; for Audio Transcription a short recording of the word hello, which must come back as text; for Text To Speech one spoken word in the voice alloy, which must come back as audio; for Moderation one harmless sentence, which must come back with a moderation result; for Image Generation and Video Generation a lookup of the model name at the endpoint (GET /models/), which proves the address and the model name (and the key, when the endpoint asks for one), not that the model draws pictures or generates videos. A Video Generation endpoint must offer OpenAI’s video requests (create a video, read its status, download it). For bedrock_cli the test request is signed with the account’s AWS key pair, in the account’s AWS region (the server’s default region when the account has none): a Converse request for Conversation, Document Summarization, Knowledge Generation and Knowledge Generation Fallback, a Converse request with the picture for Image Analysis, and for Image Generation a lookup of the model id in AWS Bedrock (GetFoundationModel for a model’s own id, which must make images; GetInferenceProfile for an inference profile id or ARN, which must be active, then GetFoundationModel on its first model, which must make images), which proves the key pair, the region and the id, not that the account may call the model. For google_cli the test request is a generateContent request for Conversation, Document Summarization, Knowledge Generation and Knowledge Generation Fallback, the same with the picture for Image Analysis, and for Image Generation and Video Analysis a lookup of the model name (GET /v1beta/models/), which must offer generateContent when the endpoint lists the model’s methods; it proves the address and the model name (and the key, when the endpoint asks for one), not that the model draws pictures or reads video. A Video Analysis model is sent a video smaller than 20 MB inside the request and a larger one through the endpoint’s file requests (upload a file, read its state, delete it); each Video Analysis request asks for up to 4,096 output tokens, or the model’s max_output_tokens when lower. Each Knowledge Generation request asks for up to the model’s max_output_tokens; the test request does not check that value. While the model is on, a change of Client Library Type, endpoint, name or key is tested the same way.
curl --request PUT \
--url https://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse} \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"client_library": "<string>",
"api_url": "<string>",
"api_key": "<string>",
"features": {},
"input_media": {},
"output_media": {},
"max_input_tokens": 123,
"max_output_tokens": 123,
"reasoning_effort": "<string>",
"extended_context": true,
"picture_url": "<string>"
}
'import requests
url = "https://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}"
payload = {
"name": "<string>",
"description": "<string>",
"client_library": "<string>",
"api_url": "<string>",
"api_key": "<string>",
"features": {},
"input_media": {},
"output_media": {},
"max_input_tokens": 123,
"max_output_tokens": 123,
"reasoning_effort": "<string>",
"extended_context": True,
"picture_url": "<string>"
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
client_library: '<string>',
api_url: '<string>',
api_key: '<string>',
features: {},
input_media: {},
output_media: {},
max_input_tokens: 123,
max_output_tokens: 123,
reasoning_effort: '<string>',
extended_context: true,
picture_url: '<string>'
})
};
fetch('https://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}', 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://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'client_library' => '<string>',
'api_url' => '<string>',
'api_key' => '<string>',
'features' => [
],
'input_media' => [
],
'output_media' => [
],
'max_input_tokens' => 123,
'max_output_tokens' => 123,
'reasoning_effort' => '<string>',
'extended_context' => true,
'picture_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <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://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"client_library\": \"<string>\",\n \"api_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"features\": {},\n \"input_media\": {},\n \"output_media\": {},\n \"max_input_tokens\": 123,\n \"max_output_tokens\": 123,\n \"reasoning_effort\": \"<string>\",\n \"extended_context\": true,\n \"picture_url\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-access-token", "<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.put("https://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"client_library\": \"<string>\",\n \"api_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"features\": {},\n \"input_media\": {},\n \"output_media\": {},\n \"max_input_tokens\": 123,\n \"max_output_tokens\": 123,\n \"reasoning_effort\": \"<string>\",\n \"extended_context\": true,\n \"picture_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/admin/accounts/{accountId}/aimodels/{modelUse}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"client_library\": \"<string>\",\n \"api_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"features\": {},\n \"input_media\": {},\n \"output_media\": {},\n \"max_input_tokens\": 123,\n \"max_output_tokens\": 123,\n \"reasoning_effort\": \"<string>\",\n \"extended_context\": true,\n \"picture_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"model": {
"modelUse": "conversationModel",
"name": "<string>",
"description": "<string>",
"api_url": "<string>",
"endpointHost": "<string>",
"client_library": "<string>",
"features": {},
"input_media": {},
"output_media": {},
"max_input_tokens": 123,
"max_output_tokens": 123,
"reasoning_effort": "<string>",
"extended_context": true,
"picture_url": "<string>",
"status": "active",
"hasApiKey": true,
"awsPair": true,
"updatedAt": "2023-11-07T05:31:56Z"
}
}Path Parameters
Body
Was this page helpful?