@gpt-core/client 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
@@ -97,6 +97,57 @@ const authenticatedClient = new GptClient({
97
97
  const workspaces = await authenticatedClient.platform.workspaces.mine();
98
98
  ```
99
99
 
100
+ ## API Versioning
101
+
102
+ The SDK uses Stripe-style API versioning. A default API version is sent with every request via the `Accept` header.
103
+
104
+ ### Default Behavior
105
+
106
+ Every request automatically includes the SDK's built-in API version:
107
+
108
+ ```http
109
+ Accept: application/vnd.api+json; version=2025-12-03
110
+ ```
111
+
112
+ No configuration is needed -- the SDK sends `DEFAULT_API_VERSION` from `base-client.ts` automatically.
113
+
114
+ ### Pinning a Version (Recommended for Production)
115
+
116
+ Pin a specific API version to protect your integration from breaking changes:
117
+
118
+ ```typescript
119
+ const client = new GptClient({
120
+ baseUrl: 'https://api.gpt-core.com',
121
+ apiKey: 'sk_live_...',
122
+ apiVersion: '2025-12-03', // Pin to this version
123
+ });
124
+ ```
125
+
126
+ ### Reading the Active Version
127
+
128
+ ```typescript
129
+ // The version the SDK is configured to send
130
+ console.log(client.apiVersion);
131
+ ```
132
+
133
+ ### Response Header
134
+
135
+ Every API response includes the version that was used to process the request:
136
+
137
+ ```
138
+ x-api-version: 2025-12-03
139
+ ```
140
+
141
+ ### Discovering Available Versions
142
+
143
+ List all supported API versions and their changelogs:
144
+
145
+ ```bash
146
+ GET /api-versions
147
+ ```
148
+
149
+ This returns the full list of versions with descriptions and deprecation status.
150
+
100
151
  ## Configuration
101
152
 
102
153
  ```typescript