Read this month's usage
method
GET
host
strait.
version
/v1
resource
/
GET /v1/usage
Auth: secret key as Authorization: Bearer. Server-side only.
Request
Where your workspace stands against its plan this calendar month (UTC): billed taps and new links, and what the plan includes (null = no limit). level is ok, warn from 80 % of the included taps, over from 100 %. Over your plan, links and deferred matching keep working: nothing here ever stops a redirect. new_links_paused is true at twice the included taps or at the plan's new-link limit; creating a link then answers 402 until you upgrade or the month ends. Secret key only (a publishable key gets 401); 30 calls a minute per workspace (429 with Retry-After).
No parameters.
Response
- 200 This month's usage, the plan and the over-limit flags.
- 401 Missing or invalid secret key, or a publishable key
- 429 Over 30 calls a minute for this workspace
curl -X GET https://strait.link/v1/usage \
-H "Authorization: Bearer $SECRET_KEY"const res = await fetch('https://strait.link/v1/usage', {
headers: { Authorization: `Bearer ${process.env.SECRET_KEY}` },
});
const data = await res.json();
console.log(res.status, data);import os
import requests
res = requests.get(
"https://strait.link/v1/usage",
headers={"Authorization": f"Bearer {os.environ['SECRET_KEY']}"},
)
print(res.status_code, res.json())<?php
// Plain PHP with ext-curl, no packages. In Laravel, Http::withToken($secretKey)->get($url) sends the same request.
$ch = curl_init('https://strait.link/v1/usage');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SECRET_KEY'),
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL;
print_r(json_decode($response, true));import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
// Java 17+, java.net.http only (no dependencies).
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://strait.link/v1/usage"))
.header("Authorization", "Bearer " + System.getenv("SECRET_KEY"))
.GET()
.build();
HttpResponse<String> res = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());
}
}package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest(http.MethodGet, "https://strait.link/v1/usage", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SECRET_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(res.StatusCode, string(data))
}The response, printed
{
"month": "2026-10",
"plan": "free",
"taps": {
"used": 21400,
"included": 25000
},
"links": {
"created": 14,
"included": 100
},
"level": "warn",
"new_links_paused": false
}