HTTP API
List models
GET
/v1/models
const url = 'https://sergo.example.com/v1/models';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://sergo.example.com/v1/models \ --header 'Authorization: Bearer <token>'The language models that presets can use, with their prices and the tokens per page they are expected to use. Send an id as model_id when you upload a file a model reads. Personal keys only.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Successful Response
Media typeapplication/json
AiModelList
object
items
required
Items
Array<object>
AiModelobject
id
required
Id
What to send as model_id
string
name
required
Name
string
provider
required
external
required
External
Pages are sent to a provider outside this install
boolean
vision
required
Vision
It can read page pictures
boolean
input_price
required
Input Price
Credits per million input tokens
number
output_price
required
Output Price
Credits per million output tokens
number
estimates
required
Estimates
Tokens per page it is expected to use, for each processor that calls a model
Array<object>
ModelEstimateobject
processor_id
required
Processor Id
string
input_tokens_per_page
required
Input Tokens Per Page
integer
output_tokens_per_page
required
Output Tokens Per Page
integer
source
required
Source
observed: the average of pages read lately. manual: set by an admin. default: the processor’s default
string
sample_count
required
Sample Count
Pages read so far that the average could use
integer
Example
{ "items": [ { "estimates": [ { "source": "observed", "sample_count": 0 } ] } ]}