//native
type Cohere = {
apiKey: string;
};
/**
* Get Dataset Usage
* View the dataset storage usage for your Organization. Each Organization can have up to 10GB of storage across all their users.
*/
export async function main(auth: Cohere) {
const url = new URL(`https://api.cohere.com/v1/datasets/usage`);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + auth.apiKey,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 428 days ago