Skip to content

[Feature]: Add support for custom HTTP headers in API requests #466

Closed
@EmilienMottet

Description

@EmilienMottet
Contributor

Description

When using OpenCommit with certain API providers or through corporate proxies, there is a need to add custom HTTP headers to API requests. This is particularly useful for authentication mechanisms like Basic Auth or when using API gateways that require specific headers.

Use Cases :

Using Basic Auth with self-hosted LLM servers (like private Ollama or Flowise instances)
Working with corporate proxies that require authentication headers
Adding API-specific headers for rate limiting or version control
Supporting API gateways that require custom headers for routing

Suggested Solution

Add a new configuration option OCO_API_CUSTOM_HEADERS that accepts a JSON string of header key-value pairs. This would allow users to specify custom headers that should be included in all API requests.

Example usage:

# Set Basic Auth header
oco config set OCO_API_CUSTOM_HEADERS='{"Authorization": "Basic dXNlcm5hbWU6cGFzc3dvcmQ="}'

# Set multiple custom headers
oco config set OCO_API_CUSTOM_HEADERS='{"X-API-Version": "2", "X-Custom-Header": "value"}'

Alternatives

No response

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @EmilienMottet

      Issue actions

        [Feature]: Add support for custom HTTP headers in API requests · Issue #466 · di-sukharev/opencommit