Adding the Codex Typescript SDK to your app
Add the SDK
Check out Codex Typescript SDK on GitHub or just get right into installation:
Add the API key to your environment variables
Usually these live in your .env
file. Add this line and replace xxxxxxxx
with your API key:
Create an SDK file
Make a new lib/codex-sdk.ts
file (or whatever folder/name fits your project) and add:
Make a request
Now you can import the SDK from other files and make requests. For example:
See more examples
Check out Codex Typescript SDK GitHub for examples of: