-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcredits.ts
More file actions
62 lines (53 loc) · 1.47 KB
/
credits.ts
File metadata and controls
62 lines (53 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
/**
* Endpoints for checking API quota and credits usage.
* These endpoints help you monitor your API usage and remaining quota.
*/
export class Credits extends APIResource {
/**
* Check your remaining API credits and usage for the current billing period.
*
* Returns:
*
* - Number of API calls used and remaining credits
* - Credit limit and reset date
* - List of enabled features for your plan
*
* Credits reset at the start of each billing period.
*/
check(options?: RequestOptions): APIPromise<CreditCheckResponse> {
return this._client.post('/v1/credits', options);
}
}
export interface CreditCheckResponse {
/**
* List of API features enabled for your plan
*/
enabled_features?: Array<string>;
/**
* Whether the account has unlimited credits
*/
is_unlimited?: boolean;
/**
* Total credit limit for billing period
*/
limit?: number;
/**
* Remaining credits (null if unlimited)
*/
remaining?: number | null;
/**
* When credits reset (ISO 8601)
*/
resets_at?: string | null;
/**
* Number of credits used this billing period
*/
used?: number;
}
export declare namespace Credits {
export { type CreditCheckResponse as CreditCheckResponse };
}