@@ -143,3 +143,82 @@ curl -X POST https://api.openai.com/v1/chat/completions \
143143</Tabs.Tab >
144144</Tabs >
145145</Steps >
146+
147+ ## Testing in OpenAI's API Playground
148+
149+ OpenAI provides an API playground for developers to test prompts and tool calling:
150+ [ https://platform.openai.com/playground/prompts ] ( https://platform.openai.com/playground/prompts?models=gpt-4.1 )
151+
152+ 1 . Navigate to [ OpenAI's playground] ( https://platform.openai.com/playground/prompts?models=gpt-4.1 ) and sign in with your OpenAI account
153+ 2 . Click the ** Create** button in the ** Tools** section, then select ** Pipedream**
154+ 3 . You'll need these inputs to get set up:
155+
156+ - [ Pipedream project ID] ( #copy-your-project-id )
157+ - [ Pipedream environment] ( #define-the-environment )
158+ - [ Developer access token] ( #generate-an-access-token )
159+
160+ <Steps >
161+
162+ ### Copy your project ID
163+
164+ 1 . Open an existing Pipedream project or create a new one at [ pipedream.com/projects] ( https://pipedream.com/projects )
165+ 2 . Click the ** Settings** tab, then copy your ** Project ID**
166+
167+ ### Define the environment
168+
169+ - Since you're testing for yourself, you should use ` development `
170+ - Use ` production ` when you're ready to ship your app to users
171+
172+ ### Generate an access token
173+
174+ ** First, create an OAuth client in Pipedream:**
175+
176+ 1 . Visit the [ API settings] ( https://pipedream.com/settings/api ) for your workspace
177+ 2 . Click the ** New OAuth Client** button and give it a name
178+ 3 . Copy the client ID and secret
179+
180+ ** Next, get an access token:**
181+
182+ In the client credentials model, as a developer, you exchange your OAuth client ID and secret for a short-lived access token to make API requests.
183+
184+ <Tabs items = { [' Node.js' , ' cURL' ]} >
185+ <Tabs.Tab >
186+ ``` javascript
187+ import { createBackendClient } from " @pipedream/sdk/server" ;
188+
189+ // Initialize the Pipedream SDK client
190+ const pd = createBackendClient ({
191+ environment: PIPEDREAM_ENVIRONMENT ,
192+ credentials: {
193+ clientId: PIPEDREAM_CLIENT_ID ,
194+ clientSecret: PIPEDREAM_CLIENT_SECRET ,
195+ },
196+ projectId: PIPEDREAM_PROJECT_ID
197+ });
198+
199+ const accessToken = await pd .rawAccessToken ();
200+
201+ console .log (accessToken);
202+ ```
203+ </Tabs.Tab >
204+ <Tabs.Tab >
205+ ``` bash
206+ curl https://api.pipedream.com/v1/oauth/token \
207+ -H ' Content-Type: application/json' \
208+ -d ' {
209+ "grant_type": "client_credentials",
210+ "client_id": "<PIPEDREAM_CLIENT_ID>",
211+ "client_secret": "<PIPEDREAM_CLIENT_SECRET>"
212+ }'
213+ ```
214+ </Tabs.Tab >
215+ </Tabs >
216+
217+ </Steps >
218+
219+ ### Playground limitations
220+
221+ - The server URL that's defined in OpenAI's playground uses two static fields. In practice, you'll define those dynamically in your app:
222+ - ` external_user_id ` : ` demo-openai-user-123 `
223+ - ` app_slug ` : ` google_calendar `
224+ - You'll also define the ` PIPEDREAM_PROJECT_ID ` and ` PIPEDREAM_ENVIRONMENT ` in your environment once, then use the Pipedream SDK or REST API to get a fresh access token.
0 commit comments