GET /v1/key
Authentication
Send Authorization: Bearer $REDROUTER_API_KEY.
Request examples
curl 'https://redrouter.org/v1/key' \
-H "Authorization: Bearer $REDROUTER_API_KEY"
import os, json
from urllib.request import Request, urlopen
request = Request(
"https://redrouter.org/v1/key",
method="GET",
headers={
"Authorization": "Bearer " + os.environ["REDROUTER_API_KEY"],
},
)
with urlopen(request) as response:
print(json.load(response))
const key = process.env.REDROUTER_API_KEY;
const response = await fetch("https://redrouter.org/v1/key", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
},
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
Responses
200 · Successful response
application/json
{
"$ref": "#/components/schemas/Key"
}
401 · Invalid key
application/json
{
"$ref": "#/components/schemas/Error"
}
403 · Expired or paused key
application/json
{
"$ref": "#/components/schemas/Error"
}
500 · Internal error
application/json
{
"$ref": "#/components/schemas/Error"
}