Update a model
curl --request PUT \
--url https://api-dev.narrative.io/models/{model_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Fine-tuned for marketing content generation",
"tags": [
"llm",
"instruct",
"marketing"
]
}
'import requests
url = "https://api-dev.narrative.io/models/{model_id}"
payload = {
"description": "Fine-tuned for marketing content generation",
"tags": ["llm", "instruct", "marketing"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Fine-tuned for marketing content generation',
tags: ['llm', 'instruct', 'marketing']
})
};
fetch('https://api-dev.narrative.io/models/{model_id}', 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-dev.narrative.io/models/{model_id}",
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([
'description' => 'Fine-tuned for marketing content generation',
'tags' => [
'llm',
'instruct',
'marketing'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api-dev.narrative.io/models/{model_id}"
payload := strings.NewReader("{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api-dev.narrative.io/models/{model_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/models/{model_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"company_id": 1,
"name": "Llama-3.1-8B-Instruct",
"display_name": "Llama 3.1 8B Instruct",
"license_id": "META-LLAMA-COMMUNITY-3.1",
"repository": {
"type": "hugging_face",
"organization": "meta-llama"
},
"collaborators": {
"view": {
"type": "all"
},
"train": {
"type": "all"
},
"deploy": {
"type": "all"
}
},
"description": "Fine-tuned Llama model for instruction following",
"tags": [
"llm",
"instruct"
],
"base_model_id": null,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": null,
"archived_at": null,
"version": 1,
"status": "active"
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}Not foundModels
Update a model
Updates a model the authenticated company owns and returns the updated model.
Only the fields provided in the request body are updated.
PUT
/
models
/
{model_id}
Update a model
curl --request PUT \
--url https://api-dev.narrative.io/models/{model_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Fine-tuned for marketing content generation",
"tags": [
"llm",
"instruct",
"marketing"
]
}
'import requests
url = "https://api-dev.narrative.io/models/{model_id}"
payload = {
"description": "Fine-tuned for marketing content generation",
"tags": ["llm", "instruct", "marketing"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Fine-tuned for marketing content generation',
tags: ['llm', 'instruct', 'marketing']
})
};
fetch('https://api-dev.narrative.io/models/{model_id}', 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-dev.narrative.io/models/{model_id}",
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([
'description' => 'Fine-tuned for marketing content generation',
'tags' => [
'llm',
'instruct',
'marketing'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api-dev.narrative.io/models/{model_id}"
payload := strings.NewReader("{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api-dev.narrative.io/models/{model_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/models/{model_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"company_id": 1,
"name": "Llama-3.1-8B-Instruct",
"display_name": "Llama 3.1 8B Instruct",
"license_id": "META-LLAMA-COMMUNITY-3.1",
"repository": {
"type": "hugging_face",
"organization": "meta-llama"
},
"collaborators": {
"view": {
"type": "all"
},
"train": {
"type": "all"
},
"deploy": {
"type": "all"
}
},
"description": "Fine-tuned Llama model for instruction following",
"tags": [
"llm",
"instruct"
],
"base_model_id": null,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": null,
"archived_at": null,
"version": 1,
"status": "active"
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}Not foundAuthorizations
Body
application/json
The fields to change. Omitted fields and fields sent as null keep their current value, and at least one field must carry a value.
Response
OK

