@gpt-core/admin 0.9.39 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -129,6 +129,58 @@ export const admin = new GptAdmin({
129
129
  });
130
130
  ```
131
131
 
132
+ ## API Versioning
133
+
134
+ The SDK uses Stripe-style API versioning. A default API version is sent with every request via the `Accept` header.
135
+
136
+ ### Default Behavior
137
+
138
+ Every request automatically includes the SDK's built-in API version:
139
+
140
+ ```http
141
+ Accept: application/vnd.api+json; version=2025-12-03
142
+ ```
143
+
144
+ No configuration is needed -- the SDK sends `DEFAULT_API_VERSION` from `base-client.ts` automatically.
145
+
146
+ ### Pinning a Version (Recommended for Production)
147
+
148
+ Pin a specific API version to protect your integration from breaking changes:
149
+
150
+ ```typescript
151
+ const admin = new GptAdmin({
152
+ baseUrl: 'https://api.gpt-core.com',
153
+ token: process.env.ADMIN_JWT_TOKEN,
154
+ applicationId: process.env.APPLICATION_ID,
155
+ apiVersion: '2025-12-03', // Pin to this version
156
+ });
157
+ ```
158
+
159
+ ### Reading the Active Version
160
+
161
+ ```typescript
162
+ // The version the SDK is configured to send
163
+ console.log(admin.apiVersion);
164
+ ```
165
+
166
+ ### Response Header
167
+
168
+ Every API response includes the version that was used to process the request:
169
+
170
+ ```
171
+ x-api-version: 2025-12-03
172
+ ```
173
+
174
+ ### Discovering Available Versions
175
+
176
+ List all supported API versions and their changelogs:
177
+
178
+ ```bash
179
+ GET /api-versions
180
+ ```
181
+
182
+ This returns the full list of versions with descriptions and deprecation status.
183
+
132
184
  ## API Reference
133
185
 
134
186
  ### Webhooks