Hey everyone,
I’m dealing with a frustrating issue while using Custom Actions in OpenAI. I’m trying to send an API request with an API key through a custom header named token to access an external API (a Git API on a private server).
Here’s what I’ve done so far:
- I configured the authentication in OpenAI’s interface, choosing the Custom option for the header and setting token as the name.
- I set up my schema correctly to send the token in the request header.
When I test the API call manually using cURL, everything works fine and the token header is recognized, and the API responds as expected.
However, when I try to run the same request through a Custom Actions, it doesn’t seem to send the token header at all. I keep getting 401 errors from the server, saying authentication is required, even though the token is configured correctly in the interface.
Has anyone else faced this issue? Is there something I might be missing with OpenAI’s handling of custom headers? Any advice or workarounds would be greatly appreciated!
Thanks in advance!
openapi: 3.1.0
info:
title: Private API
description: API to fetch data with authentication via a custom "token" header.
version: 1.0.0
servers:
- url: https://my-private-api/api/v3
description: Main server
paths:
/my-endpoint/tags:
get:
operationId: getTags
summary: Retrieve a list of tags
security:
- api_key: [] # Refers to the custom 'token' header defined below
responses:
'200':
description: A list of tags.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Tag'
tags:
- Tags
components:
securitySchemes:
api_key:
type: apiKey
in: header
name: token # Uses a custom header called "token"
schemas:
Tag:
type: object
properties:
name:
type: string