forked from NangoHQ/nango
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(integrations): add support for OpenAi (NangoHQ#2755)
## Describe your changes - Add support for OpenAi ## Issue ticket number and link [EXT-158](https://linear.app/nango/issue/EXT-158/add-support-for-openapi-api-key) --------- Co-authored-by: Samuel Bodin <[email protected]>
- Loading branch information
1 parent
0f8920c
commit a4fb2d4
Showing
6 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: OpenAI | ||
sidebarTitle: OpenAI | ||
--- | ||
|
||
API configuration: [`openai`](https://nango.dev/providers.yaml) | ||
|
||
## Features | ||
|
||
| Features | Status | | ||
| - | - | | ||
| [Auth (API Key)](/integrate/guides/authorize-an-api) | ✅ | | ||
| [Sync data](/integrate/guides/sync-data-from-an-api) | ✅ | | ||
| [Perform workflows](/integrate/guides/perform-workflows-with-an-api) | ✅ | | ||
| [Proxy requests](/integrate/guides/proxy-requests-to-an-api) | ✅ | | ||
| [Receive webhooks](/integrate/guides/receive-webhooks-from-an-api) | 🚫 (time to contribute: <48h) | | ||
|
||
<Tip>We can implement missing features in <48h, just ask for it in the [community](https://nango.dev/slack).</Tip> | ||
|
||
## Getting started | ||
|
||
- [Generate an API key in your OpenAI account](https://platform.openai.com/api-keys) | ||
- [OpenAI API docs](https://platform.openai.com/docs/api-reference/introduction) | ||
- [OpenAI Authentication](https://platform.openai.com/docs/api-reference/authentication) | ||
- [OpenAI rate limits](https://platform.openai.com/docs/guides/rate-limits) | ||
|
||
<Tip>Need help getting started? Get help in the [community](https://nango.dev/slack).</Tip> | ||
|
||
## API gotchas | ||
|
||
- OpenAI uses API_KEY auth mode with `Authorization: Bearer API_KEY` in the request header to access different endpoints. | ||
- Nango supports automatic retries based on the `x-ratelimit-reset-requests` header from OpenAI's API. This header indicates when the request limit will reset, allowing Nango to efficiently manage API calls. Unlike `x-ratelimit-reset-tokens`, which pertains to the total token usage,`x-ratelimit-reset-requests` specifically addresses the number of API requests. | ||
- For users associated with multiple organizations or accessing their projects via a legacy user API key, optional headers can be included to specify the organization and project for the API request. Organization IDs can be found on your [Organization settings](https://platform.openai.com/account/organization) page, while project IDs can be found on your [General settings](https://platform.openai.com/settings) page. | ||
- This can be done at the script level: | ||
```js | ||
const config:ProxyConfiguration = { | ||
endpoint: '/v1/models', | ||
headers: { | ||
'OpenAI-Organization': $organizationId, | ||
'OpenAI-Project': $projectId | ||
} | ||
}; | ||
``` | ||
|
||
<Note>Add Getting Started links and Gotchas by [editing this page](https://github.com/nangohq/nango/tree/master/docs-v2/integrations/all/openai.mdx)</Note> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.