Get run usage
curl --request GET \
--url https://melso.ai/api/runs/{runId}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://melso.ai/api/runs/{runId}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://melso.ai/api/runs/{runId}/usage', 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://melso.ai/api/runs/{runId}/usage",
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://melso.ai/api/runs/{runId}/usage"
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://melso.ai/api/runs/{runId}/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://melso.ai/api/runs/{runId}/usage")
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{
"run_id": "<string>",
"task_id": "<string>",
"workspace_id": "<string>",
"funding": {
"source": "<string>",
"account_id": "<string>"
},
"as_of": "2023-11-07T05:31:56Z",
"final": true,
"pending_count": 123,
"customer_billed_ticks": "<string>",
"reported_model_cost_ticks": "<string>",
"reported_model_cost_updated_at": "2023-11-07T05:31:56Z",
"receipts": [
{
"receipt_id": "<string>",
"usage_id": "<string>",
"category": "<string>",
"customer_billed_ticks": "<string>",
"estimated": true,
"settled_at": "2023-11-07T05:31:56Z"
}
],
"usage": [
{
"usage_id": "<string>",
"category": "<string>",
"status": "<string>",
"customer_billed_ticks": "<string>",
"revision": 123,
"closed": true
}
],
"execution_identity_id": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Runs
Get run usage
Authenticated member; company membership and credential scope apply.
GET
/
api
/
runs
/
{runId}
/
usage
Get run usage
curl --request GET \
--url https://melso.ai/api/runs/{runId}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://melso.ai/api/runs/{runId}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://melso.ai/api/runs/{runId}/usage', 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://melso.ai/api/runs/{runId}/usage",
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://melso.ai/api/runs/{runId}/usage"
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://melso.ai/api/runs/{runId}/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://melso.ai/api/runs/{runId}/usage")
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{
"run_id": "<string>",
"task_id": "<string>",
"workspace_id": "<string>",
"funding": {
"source": "<string>",
"account_id": "<string>"
},
"as_of": "2023-11-07T05:31:56Z",
"final": true,
"pending_count": 123,
"customer_billed_ticks": "<string>",
"reported_model_cost_ticks": "<string>",
"reported_model_cost_updated_at": "2023-11-07T05:31:56Z",
"receipts": [
{
"receipt_id": "<string>",
"usage_id": "<string>",
"category": "<string>",
"customer_billed_ticks": "<string>",
"estimated": true,
"settled_at": "2023-11-07T05:31:56Z"
}
],
"usage": [
{
"usage_id": "<string>",
"category": "<string>",
"status": "<string>",
"customer_billed_ticks": "<string>",
"revision": 123,
"closed": true
}
],
"execution_identity_id": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Company API key (mwk_) or personal access token (mel_). A PAT requires X-Workspace-ID on company-scoped routes. An API key implies its own company.
Headers
Company UUID for a personal token on company-scoped operations. A company API key already binds its company.
Path Parameters
runId from the corresponding authorized response.
Response
Successful response.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes