- Template Launch: New template for GPT Actions API creation.
- API Key Authentication: Supports API key authorization for secure access.
- Tech Stack: NestJS, TypeScript, Zod, And Vercel
- Local Testing: Integrated tunnel for local environment trials.
git clone https://github.com:Leizhenpeng/gpts-action-apikey-template.git
cd gpts-action-apikey-template
# dev
pnpm install
pnpm run cpolar # tunnel local port
cp .env.example .env
pnpm run dev
# production
vercel
In .env File
- Change
BASE_URL
with yours - Set
API_KEY
with yours - (Not required) Set
SENTRY_DSN
to enable Sentry error reporting
In main.ts File
- Set the
Title
andDescription
of the API
- Look at wikipedia.controller.ts and wikipedia.dto.ts to see how to add a new action
OpenAI provides identifying information with each query. You can access them in routes using the ChatGptHeaders decorator
@Post('/my/path')
function myPath(@ChatGptHeaders() headers: ChatGptHeaders) {}
The OpenAPI schema's URL will be shown in the terminal window in blue.Copy it
In "actions" section of your GPTs app:
- Click "Create New Action"
- Click on "Import from URL"
- Paste the URL.
- Click "Import"