Skip to content

Commit 4bc4dd1

Browse files
authored
Merge pull request hey-api#2485 from bombillazo/feat/readme-api-registry-support
Add ReadMe API Registry input support
2 parents 726cae7 + e074a36 commit 4bc4dd1

File tree

9 files changed

+661
-121
lines changed

9 files changed

+661
-121
lines changed

.changeset/soft-wolves-develop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/openapi-ts": patch
3+
---
4+
5+
feat(parser): input supports ReadMe API Registry with `readme:` prefix

docs/openapi-ts/configuration/input.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,42 @@ export default {
5252
If you use an HTTPS URL with a self-signed certificate in development, you will need to set [`NODE_TLS_REJECT_UNAUTHORIZED=0`](https://github.com/hey-api/openapi-ts/issues/276#issuecomment-2043143501) in your environment.
5353
:::
5454

55+
### ReadMe API Registry
56+
57+
You can use ReadMe API Registry UUIDs to fetch OpenAPI specifications directly from ReadMe's platform. This is useful when API providers use ReadMe as their source of truth for API documentation.
58+
59+
::: code-group
60+
61+
```js [simple format]
62+
export default {
63+
input: 'readme:abc123def456', // [!code ++]
64+
};
65+
```
66+
67+
```js [full format]
68+
export default {
69+
input: 'readme:@organization/project#abc123def456', // [!code ++]
70+
};
71+
```
72+
73+
```js [object format]
74+
export default {
75+
input: {
76+
path: 'readme:abc123def456', // [!code ++]
77+
// ...other options
78+
},
79+
};
80+
```
81+
82+
:::
83+
84+
The ReadMe input formats are:
85+
86+
- `readme:uuid` - Simple format using only the UUID
87+
- `readme:@organization/project#uuid` - Full format including organization and project names
88+
89+
Both formats will fetch the OpenAPI specification from `https://dash.readme.com/api/v1/api-registry/{uuid}`.
90+
5591
### Hey API Platform options
5692

5793
You might want to use the [Hey API Platform](/openapi-ts/integrations) to store your specifications. If you do so, the `input` object provides options to help with constructing the correct URL.

examples/openapi-ts-openai/src/client/types.gen.ts

Lines changed: 116 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -194,48 +194,48 @@ export type AssistantStreamEvent =
194194
} & ErrorEvent);
195195

196196
export const AssistantSupportedModels = {
197+
GPT_3_5_TURBO: 'gpt-3.5-turbo',
198+
GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125',
199+
GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613',
200+
GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106',
201+
GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k',
202+
GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613',
203+
GPT_4: 'gpt-4',
197204
GPT_4O: 'gpt-4o',
198205
GPT_4O_2024_05_13: 'gpt-4o-2024-05-13',
199206
GPT_4O_2024_08_06: 'gpt-4o-2024-08-06',
200207
GPT_4O_2024_11_20: 'gpt-4o-2024-11-20',
201-
GPT_4_1: 'gpt-4.1',
202208
GPT_4O_MINI: 'gpt-4o-mini',
203-
GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14',
204209
GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18',
205-
GPT_4_1_MINI: 'gpt-4.1-mini',
206210
GPT_4_0125_PREVIEW: 'gpt-4-0125-preview',
207-
GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14',
208-
GPT_4: 'gpt-4',
209-
GPT_4_1_NANO: 'gpt-4.1-nano',
210211
GPT_4_0314: 'gpt-4-0314',
211-
GPT_5: 'gpt-5',
212212
GPT_4_0613: 'gpt-4-0613',
213-
GPT_5_2025_08_07: 'gpt-5-2025-08-07',
214-
GPT_3_5_TURBO: 'gpt-3.5-turbo',
215-
GPT_5_MINI: 'gpt-5-mini',
216-
GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613',
217-
GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07',
218-
GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125',
219-
GPT_5_NANO: 'gpt-5-nano',
220-
GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106',
221-
GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k',
222-
GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07',
223-
GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613',
224-
GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14',
213+
GPT_4_1: 'gpt-4.1',
225214
GPT_4_1106_PREVIEW: 'gpt-4-1106-preview',
226-
O1: 'o1',
215+
GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14',
216+
GPT_4_1_MINI: 'gpt-4.1-mini',
217+
GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14',
218+
GPT_4_1_NANO: 'gpt-4.1-nano',
219+
GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14',
227220
GPT_4_32K: 'gpt-4-32k',
228-
O3_MINI: 'o3-mini',
229221
GPT_4_32K_0314: 'gpt-4-32k-0314',
230-
O3_MINI_2025_01_31: 'o3-mini-2025-01-31',
231222
GPT_4_32K_0613: 'gpt-4-32k-0613',
232-
O1_2024_12_17: 'o1-2024-12-17',
233223
GPT_4_5_PREVIEW: 'gpt-4.5-preview',
234224
GPT_4_5_PREVIEW_2025_02_27: 'gpt-4.5-preview-2025-02-27',
235225
GPT_4_TURBO: 'gpt-4-turbo',
236226
GPT_4_TURBO_2024_04_09: 'gpt-4-turbo-2024-04-09',
237227
GPT_4_TURBO_PREVIEW: 'gpt-4-turbo-preview',
238228
GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview',
229+
GPT_5: 'gpt-5',
230+
GPT_5_2025_08_07: 'gpt-5-2025-08-07',
231+
GPT_5_MINI: 'gpt-5-mini',
232+
GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07',
233+
GPT_5_NANO: 'gpt-5-nano',
234+
GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07',
235+
O1: 'o1',
236+
O1_2024_12_17: 'o1-2024-12-17',
237+
O3_MINI: 'o3-mini',
238+
O3_MINI_2025_01_31: 'o3-mini-2025-01-31',
239239
} as const;
240240

241241
export type AssistantSupportedModels =
@@ -702,38 +702,58 @@ export type AuditLog = {
702702
/**
703703
* The details for events with this `type`.
704704
*/
705-
'user.added'?: {
706-
/**
707-
* The user ID.
708-
*/
709-
id?: string;
705+
'rate_limit.updated'?: {
710706
/**
711-
* The payload used to add the user to the project.
707+
* The payload used to update the rate limits.
712708
*/
713-
data?: {
709+
changes_requested?: {
714710
/**
715-
* The role of the user. Is either `owner` or `member`.
711+
* The maximum batch input tokens per day. Only relevant for certain models.
716712
*/
717-
role?: string;
713+
batch_1_day_max_input_tokens?: number;
714+
/**
715+
* The maximum audio megabytes per minute. Only relevant for certain models.
716+
*/
717+
max_audio_megabytes_per_1_minute?: number;
718+
/**
719+
* The maximum images per minute. Only relevant for certain models.
720+
*/
721+
max_images_per_1_minute?: number;
722+
/**
723+
* The maximum requests per day. Only relevant for certain models.
724+
*/
725+
max_requests_per_1_day?: number;
726+
/**
727+
* The maximum requests per minute.
728+
*/
729+
max_requests_per_1_minute?: number;
730+
/**
731+
* The maximum tokens per minute.
732+
*/
733+
max_tokens_per_1_minute?: number;
718734
};
735+
/**
736+
* The rate limit ID
737+
*/
738+
id?: string;
719739
};
720740
/**
721741
* The details for events with this `type`.
722742
*/
723-
'user.updated'?: {
724-
/**
725-
* The project ID.
726-
*/
727-
id?: string;
743+
'service_account.created'?: {
728744
/**
729-
* The payload used to update the user.
745+
* The payload used to create the service account.
730746
*/
731-
changes_requested?: {
747+
data?: {
732748
/**
733-
* The role of the user. Is either `owner` or `member`.
749+
* The role of the service account. Is either `owner` or `member`.
734750
*/
735751
role?: string;
736752
};
753+
/**
754+
* The service account ID.
755+
*/
756+
id?: string;
737757
};
738758
/**
739759
* The details for events with this `type`.
@@ -762,69 +782,49 @@ export type AuditLog = {
762782
*/
763783
id?: string;
764784
};
785+
type: AuditLogEventType;
765786
/**
766787
* The details for events with this `type`.
767788
*/
768-
'rate_limit.updated'?: {
789+
'user.added'?: {
769790
/**
770-
* The payload used to update the rate limits.
791+
* The payload used to add the user to the project.
771792
*/
772-
changes_requested?: {
773-
/**
774-
* The maximum requests per minute.
775-
*/
776-
max_requests_per_1_minute?: number;
777-
/**
778-
* The maximum tokens per minute.
779-
*/
780-
max_tokens_per_1_minute?: number;
781-
/**
782-
* The maximum images per minute. Only relevant for certain models.
783-
*/
784-
max_images_per_1_minute?: number;
785-
/**
786-
* The maximum audio megabytes per minute. Only relevant for certain models.
787-
*/
788-
max_audio_megabytes_per_1_minute?: number;
789-
/**
790-
* The maximum requests per day. Only relevant for certain models.
791-
*/
792-
max_requests_per_1_day?: number;
793+
data?: {
793794
/**
794-
* The maximum batch input tokens per day. Only relevant for certain models.
795+
* The role of the user. Is either `owner` or `member`.
795796
*/
796-
batch_1_day_max_input_tokens?: number;
797+
role?: string;
797798
};
798799
/**
799-
* The rate limit ID
800+
* The user ID.
800801
*/
801802
id?: string;
802803
};
803-
type: AuditLogEventType;
804804
/**
805805
* The details for events with this `type`.
806806
*/
807-
'service_account.created'?: {
808-
/**
809-
* The payload used to create the service account.
810-
*/
811-
data?: {
812-
/**
813-
* The role of the service account. Is either `owner` or `member`.
814-
*/
815-
role?: string;
816-
};
807+
'user.deleted'?: {
817808
/**
818-
* The service account ID.
809+
* The user ID.
819810
*/
820811
id?: string;
821812
};
822813
/**
823814
* The details for events with this `type`.
824815
*/
825-
'user.deleted'?: {
816+
'user.updated'?: {
826817
/**
827-
* The user ID.
818+
* The payload used to update the user.
819+
*/
820+
changes_requested?: {
821+
/**
822+
* The role of the user. Is either `owner` or `member`.
823+
*/
824+
role?: string;
825+
};
826+
/**
827+
* The project ID.
828828
*/
829829
id?: string;
830830
};
@@ -18135,69 +18135,69 @@ export type MessageContentDelta =
1813518135
} & MessageDeltaContentImageUrlObject);
1813618136

1813718137
export const ChatModel = {
18138-
GPT_4_1: 'gpt-4.1',
18139-
GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14',
18140-
GPT_4_1_MINI: 'gpt-4.1-mini',
18141-
GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14',
18142-
GPT_4_1_NANO: 'gpt-4.1-nano',
18138+
CHATGPT_4O_LATEST: 'chatgpt-4o-latest',
18139+
CODEX_MINI_LATEST: 'codex-mini-latest',
18140+
GPT_3_5_TURBO: 'gpt-3.5-turbo',
18141+
GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125',
18142+
GPT_3_5_TURBO_0301: 'gpt-3.5-turbo-0301',
18143+
GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613',
18144+
GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106',
18145+
GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k',
18146+
GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613',
18147+
GPT_4: 'gpt-4',
1814318148
GPT_4O: 'gpt-4o',
18144-
GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14',
18145-
GPT_4O_2024_08_06: 'gpt-4o-2024-08-06',
18146-
GPT_5: 'gpt-5',
1814718149
GPT_4O_2024_05_13: 'gpt-4o-2024-05-13',
18148-
GPT_5_2025_08_07: 'gpt-5-2025-08-07',
18150+
GPT_4O_2024_08_06: 'gpt-4o-2024-08-06',
1814918151
GPT_4O_2024_11_20: 'gpt-4o-2024-11-20',
18150-
GPT_5_CHAT_LATEST: 'gpt-5-chat-latest',
1815118152
GPT_4O_AUDIO_PREVIEW: 'gpt-4o-audio-preview',
18152-
GPT_5_MINI: 'gpt-5-mini',
1815318153
GPT_4O_AUDIO_PREVIEW_2024_10_01: 'gpt-4o-audio-preview-2024-10-01',
18154-
GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07',
1815518154
GPT_4O_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-audio-preview-2024-12-17',
18156-
GPT_5_NANO: 'gpt-5-nano',
1815718155
GPT_4O_AUDIO_PREVIEW_2025_06_03: 'gpt-4o-audio-preview-2025-06-03',
18158-
GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07',
18159-
CHATGPT_4O_LATEST: 'chatgpt-4o-latest',
18160-
O1: 'o1',
18161-
CODEX_MINI_LATEST: 'codex-mini-latest',
18162-
O1_2024_12_17: 'o1-2024-12-17',
1816318156
GPT_4O_MINI: 'gpt-4o-mini',
18164-
O1_MINI: 'o1-mini',
1816518157
GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18',
18166-
O3: 'o3',
18167-
GPT_4: 'gpt-4',
18168-
O3_2025_04_16: 'o3-2025-04-16',
1816918158
GPT_4O_MINI_AUDIO_PREVIEW: 'gpt-4o-mini-audio-preview',
18170-
O4_MINI: 'o4-mini',
1817118159
GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-mini-audio-preview-2024-12-17',
18172-
O4_MINI_2025_04_16: 'o4-mini-2025-04-16',
18173-
GPT_3_5_TURBO: 'gpt-3.5-turbo',
18174-
O3_MINI: 'o3-mini',
18175-
GPT_3_5_TURBO_0301: 'gpt-3.5-turbo-0301',
18176-
O3_MINI_2025_01_31: 'o3-mini-2025-01-31',
18177-
GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613',
18178-
O1_PREVIEW: 'o1-preview',
18179-
GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125',
18180-
O1_PREVIEW_2024_09_12: 'o1-preview-2024-09-12',
18181-
GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106',
18182-
O1_MINI_2024_09_12: 'o1-mini-2024-09-12',
18183-
GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k',
1818418160
GPT_4O_MINI_SEARCH_PREVIEW: 'gpt-4o-mini-search-preview',
18185-
GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613',
1818618161
GPT_4O_MINI_SEARCH_PREVIEW_2025_03_11:
1818718162
'gpt-4o-mini-search-preview-2025-03-11',
1818818163
GPT_4O_SEARCH_PREVIEW: 'gpt-4o-search-preview',
1818918164
GPT_4O_SEARCH_PREVIEW_2025_03_11: 'gpt-4o-search-preview-2025-03-11',
1819018165
GPT_4_0125_PREVIEW: 'gpt-4-0125-preview',
1819118166
GPT_4_0314: 'gpt-4-0314',
1819218167
GPT_4_0613: 'gpt-4-0613',
18168+
GPT_4_1: 'gpt-4.1',
1819318169
GPT_4_1106_PREVIEW: 'gpt-4-1106-preview',
18170+
GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14',
18171+
GPT_4_1_MINI: 'gpt-4.1-mini',
18172+
GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14',
18173+
GPT_4_1_NANO: 'gpt-4.1-nano',
18174+
GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14',
1819418175
GPT_4_32K: 'gpt-4-32k',
1819518176
GPT_4_32K_0314: 'gpt-4-32k-0314',
1819618177
GPT_4_32K_0613: 'gpt-4-32k-0613',
1819718178
GPT_4_TURBO: 'gpt-4-turbo',
1819818179
GPT_4_TURBO_2024_04_09: 'gpt-4-turbo-2024-04-09',
1819918180
GPT_4_TURBO_PREVIEW: 'gpt-4-turbo-preview',
1820018181
GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview',
18182+
GPT_5: 'gpt-5',
18183+
GPT_5_2025_08_07: 'gpt-5-2025-08-07',
18184+
GPT_5_CHAT_LATEST: 'gpt-5-chat-latest',
18185+
GPT_5_MINI: 'gpt-5-mini',
18186+
GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07',
18187+
GPT_5_NANO: 'gpt-5-nano',
18188+
GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07',
18189+
O1: 'o1',
18190+
O1_2024_12_17: 'o1-2024-12-17',
18191+
O1_MINI: 'o1-mini',
18192+
O1_MINI_2024_09_12: 'o1-mini-2024-09-12',
18193+
O1_PREVIEW: 'o1-preview',
18194+
O1_PREVIEW_2024_09_12: 'o1-preview-2024-09-12',
18195+
O3: 'o3',
18196+
O3_2025_04_16: 'o3-2025-04-16',
18197+
O3_MINI: 'o3-mini',
18198+
O3_MINI_2025_01_31: 'o3-mini-2025-01-31',
18199+
O4_MINI: 'o4-mini',
18200+
O4_MINI_2025_04_16: 'o4-mini-2025-04-16',
1820118201
} as const;
1820218202

1820318203
export type ChatModel = (typeof ChatModel)[keyof typeof ChatModel];

0 commit comments

Comments
 (0)