API key
Your API key authenticates requests to the Uthana GraphQL API. Keep it private and rotate it if you suspect it has leaked.
Get your API key
- Create an account at uthana.com.
- Choose an API-enabled plan on the pricing page.
- Open your account settings at uthana.com/app/account.
- Generate a new API key.
- (Optional) paste it into the
API keyfield (in the top-right corner of the page) to use it with the Uthana API docs (desktop version only).
Use your API key
Uthana uses Basic auth with your API key as the username and an empty password.
- Shell
- Python
- TypeScript
- C#
API_KEY="{{apiKey}}"
curl "https://uthana.com/graphql" \
-u $API_KEY: \
-H "Content-Type: application/json" \
-d '{"query": "{ __typename }"}'
import requests
API_URL = "https://uthana.com/graphql"
API_KEY = "{{apiKey}}"
response = requests.post(
API_URL,
auth=(API_KEY, ""),
json={"query": "{ __typename }"},
)
print(response.json())
const API_URL = "https://uthana.com/graphql";
const API_KEY = "{{apiKey}}";
const response = await fetch(API_URL, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Basic ${btoa(`${API_KEY}:`)}`,
},
body: JSON.stringify({ query: "{ __typename }" }),
});
console.log(await response.json());
var request = new
{
query = "{ __typename }"
};
var json = JsonSerializer.Serialize(request);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var authValue = Convert.ToBase64String(Encoding.UTF8.GetBytes("{{apiKey}}:"));
_httpClient.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authValue);
var response = await _httpClient.PostAsync("https://uthana.com/graphql", content);
response.EnsureSuccessStatusCode();
Security tips
- Treat your API key like a password.
- Store it in a secret manager or environment variable.
- Rotate the key if it appears in logs or shared code.