curl --request GET \
--url https://api-dev.narrative.io/models/{model_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/models/{model_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/models/{model_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-dev.narrative.io/models/{model_id}")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 2,
"company_id": 1,
"name": "Llama-3.1-8B-Instruct",
"license_id": "META-LLAMA-COMMUNITY-3.1",
"repository": {
"type": "hugging_face",
"organization": "meta-llama"
},
"collaborators": {
"training": {
"type": "all"
},
"inference": {
"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."
}Get a model
Returns a single model by its ID.
curl --request GET \
--url https://api-dev.narrative.io/models/{model_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/models/{model_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/models/{model_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-dev.narrative.io/models/{model_id}")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 2,
"company_id": 1,
"name": "Llama-3.1-8B-Instruct",
"license_id": "META-LLAMA-COMMUNITY-3.1",
"repository": {
"type": "hugging_face",
"organization": "meta-llama"
},
"collaborators": {
"training": {
"type": "all"
},
"inference": {
"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."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier for a model.
Response
OK
Unique identifier for the model.
The ID of the company that owns this model.
A unique identifier for the model within the company's namespace.
Model names must consist of only alphanumeric characters, underscores, dashes, and dots, and be <= 256 characters long.
The license identifier (e.g., "META-LLAMA-COMMUNITY-3.1", "apache-2.0").
- Option 1
- Option 2
Show child attributes
Show child attributes
{
"type": "hugging_face",
"organization": "meta-llama"
}
Defines which companies have access to train and run inference on this model.
Show child attributes
Show child attributes
{
"training": { "type": "all" },
"inference": {
"type": "inclusion",
"companies": [1, 2, 3]
}
}
List of tags associated with the model.
When the model was created.
Model version number.
Current status of the model.
active, archived A human readable name for the model.
Model names must be non-empty and can only contain up to 512 characters.
Optional description of the model.
ID of the base model this model was derived from (if applicable).
When the model was last updated.
When the model was archived (if applicable).
Was this page helpful?

