Documentation Index
Fetch the complete documentation index at: https://docs.natecosmic.com/llms.txt
Use this file to discover all available pages before exploring further.
Use this quickstart to call COSMIC APIs in a few minutes with a personal access token.
1) Create a personal access token
Generate a token
Create a token and copy it.
Store it securely
Save it in an environment variable for local testing.
export COSMIC_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
Treat access tokens as secrets. Do not commit them to source control.
2) Make your first API request
Use your token in the Authorization header as a bearer token.
curl -sS -X GET "https://api.natecosmic.com/v1/me" \
-H "Authorization: Bearer $COSMIC_ACCESS_TOKEN" \
-H "Accept: application/json"
const response = await fetch("https://api.natecosmic.com/v1/me", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.COSMIC_ACCESS_TOKEN}`,
Accept: "application/json",
},
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
import os
import requests
response = requests.get(
"https://api.natecosmic.com/v1/me",
headers={
"Authorization": f"Bearer {os.environ['COSMIC_ACCESS_TOKEN']}",
"Accept": "application/json",
},
timeout=30,
)
response.raise_for_status()
print(response.json())
If the request fails with 401, your token may be expired. Personal access
tokens expire after one hour, so create a new token and retry.
Next steps
- Fetch user certification records from
GET /v1/certifications
- Review available endpoints in API reference
- Learn token behavior in Access tokens
- Build a production integration with Creating apps
- Implement full user authorization in OAuth