Create an agent rate card
curl --request POST \
--url https://api.hyperline.co/v1/agents/rate-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"rows": [
{
"provider": "<string>",
"model": "<string>",
"rate_per_m_input": "<string>",
"rate_per_m_output": "<string>",
"rate_unit": "<string>",
"rate_per_m_cached_input": "<string>",
"rate_per_m_cache_write": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>"
}
]
}
],
"description": "<string>",
"fallback_per_usd": "<string>",
"currency": "<string>"
}
'import requests
url = "https://api.hyperline.co/v1/agents/rate-cards"
payload = {
"name": "<string>",
"rows": [
{
"provider": "<string>",
"model": "<string>",
"rate_per_m_input": "<string>",
"rate_per_m_output": "<string>",
"rate_unit": "<string>",
"rate_per_m_cached_input": "<string>",
"rate_per_m_cache_write": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>"
}
]
}
],
"description": "<string>",
"fallback_per_usd": "<string>",
"currency": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
rows: [
{
provider: '<string>',
model: '<string>',
rate_per_m_input: '<string>',
rate_per_m_output: '<string>',
rate_unit: '<string>',
rate_per_m_cached_input: '<string>',
rate_per_m_cache_write: '<string>',
dimensions: [{key: '<string>', rate: '<string>'}]
}
],
description: '<string>',
fallback_per_usd: '<string>',
currency: '<string>'
})
};
fetch('https://api.hyperline.co/v1/agents/rate-cards', 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.hyperline.co/v1/agents/rate-cards",
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([
'name' => '<string>',
'rows' => [
[
'provider' => '<string>',
'model' => '<string>',
'rate_per_m_input' => '<string>',
'rate_per_m_output' => '<string>',
'rate_unit' => '<string>',
'rate_per_m_cached_input' => '<string>',
'rate_per_m_cache_write' => '<string>',
'dimensions' => [
[
'key' => '<string>',
'rate' => '<string>'
]
]
]
],
'description' => '<string>',
'fallback_per_usd' => '<string>',
'currency' => '<string>'
]),
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.hyperline.co/v1/agents/rate-cards"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"rows\": [\n {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"rate_per_m_input\": \"<string>\",\n \"rate_per_m_output\": \"<string>\",\n \"rate_unit\": \"<string>\",\n \"rate_per_m_cached_input\": \"<string>\",\n \"rate_per_m_cache_write\": \"<string>\",\n \"dimensions\": [\n {\n \"key\": \"<string>\",\n \"rate\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"<string>\",\n \"fallback_per_usd\": \"<string>\",\n \"currency\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.hyperline.co/v1/agents/rate-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"rows\": [\n {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"rate_per_m_input\": \"<string>\",\n \"rate_per_m_output\": \"<string>\",\n \"rate_unit\": \"<string>\",\n \"rate_per_m_cached_input\": \"<string>\",\n \"rate_per_m_cache_write\": \"<string>\",\n \"dimensions\": [\n {\n \"key\": \"<string>\",\n \"rate\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"<string>\",\n \"fallback_per_usd\": \"<string>\",\n \"currency\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/agents/rate-cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"rows\": [\n {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"rate_per_m_input\": \"<string>\",\n \"rate_per_m_output\": \"<string>\",\n \"rate_unit\": \"<string>\",\n \"rate_per_m_cached_input\": \"<string>\",\n \"rate_per_m_cache_write\": \"<string>\",\n \"dimensions\": [\n {\n \"key\": \"<string>\",\n \"rate\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"<string>\",\n \"fallback_per_usd\": \"<string>\",\n \"currency\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"denomination": "credits",
"currency": "<string>",
"description": "<string>",
"fallback_per_usd": "<string>",
"rows": [
{
"id": "<string>",
"kind": "llm",
"provider": "<string>",
"model": "<string>",
"rate_per_m_input": "<string>",
"rate_per_m_output": "<string>",
"rate_unit": "<string>",
"rate_per_m_cached_input": "<string>",
"rate_per_m_cache_write": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>",
"per": "1m"
}
]
}
],
"attached_product_id": "<string>",
"using_policy_count": 123,
"using_policies": [
{
"customer_id": "<string>",
"customer_name": "<string>",
"agent_slug": "<string>"
}
],
"using_plan_count": 123
}Agents
Create an agent rate card
Make a new card. An llm row states as much as it wants to constrain — provider, model, both, or neither — and the most specific matching row prices a call. fallback_per_usd prices anything the card does not name, off the USD price registry. denomination and currency are fixed at creation.
POST
/
v1
/
agents
/
rate-cards
Create an agent rate card
curl --request POST \
--url https://api.hyperline.co/v1/agents/rate-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"rows": [
{
"provider": "<string>",
"model": "<string>",
"rate_per_m_input": "<string>",
"rate_per_m_output": "<string>",
"rate_unit": "<string>",
"rate_per_m_cached_input": "<string>",
"rate_per_m_cache_write": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>"
}
]
}
],
"description": "<string>",
"fallback_per_usd": "<string>",
"currency": "<string>"
}
'import requests
url = "https://api.hyperline.co/v1/agents/rate-cards"
payload = {
"name": "<string>",
"rows": [
{
"provider": "<string>",
"model": "<string>",
"rate_per_m_input": "<string>",
"rate_per_m_output": "<string>",
"rate_unit": "<string>",
"rate_per_m_cached_input": "<string>",
"rate_per_m_cache_write": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>"
}
]
}
],
"description": "<string>",
"fallback_per_usd": "<string>",
"currency": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
rows: [
{
provider: '<string>',
model: '<string>',
rate_per_m_input: '<string>',
rate_per_m_output: '<string>',
rate_unit: '<string>',
rate_per_m_cached_input: '<string>',
rate_per_m_cache_write: '<string>',
dimensions: [{key: '<string>', rate: '<string>'}]
}
],
description: '<string>',
fallback_per_usd: '<string>',
currency: '<string>'
})
};
fetch('https://api.hyperline.co/v1/agents/rate-cards', 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.hyperline.co/v1/agents/rate-cards",
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([
'name' => '<string>',
'rows' => [
[
'provider' => '<string>',
'model' => '<string>',
'rate_per_m_input' => '<string>',
'rate_per_m_output' => '<string>',
'rate_unit' => '<string>',
'rate_per_m_cached_input' => '<string>',
'rate_per_m_cache_write' => '<string>',
'dimensions' => [
[
'key' => '<string>',
'rate' => '<string>'
]
]
]
],
'description' => '<string>',
'fallback_per_usd' => '<string>',
'currency' => '<string>'
]),
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.hyperline.co/v1/agents/rate-cards"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"rows\": [\n {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"rate_per_m_input\": \"<string>\",\n \"rate_per_m_output\": \"<string>\",\n \"rate_unit\": \"<string>\",\n \"rate_per_m_cached_input\": \"<string>\",\n \"rate_per_m_cache_write\": \"<string>\",\n \"dimensions\": [\n {\n \"key\": \"<string>\",\n \"rate\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"<string>\",\n \"fallback_per_usd\": \"<string>\",\n \"currency\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.hyperline.co/v1/agents/rate-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"rows\": [\n {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"rate_per_m_input\": \"<string>\",\n \"rate_per_m_output\": \"<string>\",\n \"rate_unit\": \"<string>\",\n \"rate_per_m_cached_input\": \"<string>\",\n \"rate_per_m_cache_write\": \"<string>\",\n \"dimensions\": [\n {\n \"key\": \"<string>\",\n \"rate\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"<string>\",\n \"fallback_per_usd\": \"<string>\",\n \"currency\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/agents/rate-cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"rows\": [\n {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"rate_per_m_input\": \"<string>\",\n \"rate_per_m_output\": \"<string>\",\n \"rate_unit\": \"<string>\",\n \"rate_per_m_cached_input\": \"<string>\",\n \"rate_per_m_cache_write\": \"<string>\",\n \"dimensions\": [\n {\n \"key\": \"<string>\",\n \"rate\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"<string>\",\n \"fallback_per_usd\": \"<string>\",\n \"currency\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"denomination": "credits",
"currency": "<string>",
"description": "<string>",
"fallback_per_usd": "<string>",
"rows": [
{
"id": "<string>",
"kind": "llm",
"provider": "<string>",
"model": "<string>",
"rate_per_m_input": "<string>",
"rate_per_m_output": "<string>",
"rate_unit": "<string>",
"rate_per_m_cached_input": "<string>",
"rate_per_m_cache_write": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>",
"per": "1m"
}
]
}
],
"attached_product_id": "<string>",
"using_policy_count": 123,
"using_policies": [
{
"customer_id": "<string>",
"customer_name": "<string>",
"agent_slug": "<string>"
}
],
"using_plan_count": 123
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Create rate card payload
Required string length:
1 - 120Maximum array length:
1000Show child attributes
Show child attributes
Available options:
credits, units, currency Maximum string length:
280Pattern:
^\d+(\.\d+)?$Required string length:
3Response
201 - application/json
Available options:
credits, units, currency Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I

