FlexHarness Providers supplies all model adapters and provider capabilities in one package. Import a specific subpath to select the implementation you use.

## Issue Reporting and Security

For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.

## Install and use

```sh
pnpm add @modelprofile.com/flexharness-providers @modelprofile.com/flexharness-models
```

```typescript
import { ModelRegistry } from '@modelprofile.com/flexharness-models';
import { createOpenAiModelProvider } from '@modelprofile.com/flexharness-providers/openai';

const models = new ModelRegistry().register(createOpenAiModelProvider());
const model = models.getModel({ provider: 'openai', model: 'gpt-5.5', apiKey: process.env.OPENAI_API_KEY });
```

## Provider subpaths

Install `@modelprofile.com/flexharness-providers` once. Its root exports all provider
factories; use a provider subpath to import just that implementation.

| Import suffix | Capability |
| --- | --- |
| `/anthropic`, `/openai`, `/google`, `/groq`, `/mistral`, `/xai`, `/perplexity`, `/ollama` | Model adapters and their request types |
| `/auth` | ChatGPT browser/device authentication, refresh and model connections |
| `/accounts` | Account lifecycle, model catalogs, rate limits and credential envelopes |
| `/auth/files` | Explicit interoperability with external credential files |
| `/media` | OpenAI audio and image generation |
| `/research` | Anthropic research utilities |
| `/anthropic-messages`, `/anthropic-messages/node` | Serves the Anthropic Messages API over FlexHarness models, for Anthropic clients such as Claude Code |

Every model adapter sends its requests to `baseUrl` when the options name one, for
example a proxy, and to the vendor's API otherwise; a `connection`, where an adapter
takes one, brings its own address instead. `/research` and the OpenAI audio and image
helpers of `/media` always call the vendor's API. None of them takes an address from the
environment: a set `ANTHROPIC_BASE_URL` or `OPENAI_BASE_URL` changes nothing.

A streamed answer ends at its stream's terminal event, not at the end of the connection
(AGL-1130). `/anthropic` ends it at `message_stop` and `/openai` at the Responses API's
`response.completed` or `response.incomplete` or Chat Completions' `data: [DONE]`; each ends a
failed answer at its dialect's failure frame (Anthropic's `error` event, Responses'
`response.failed` or `error` event, a Chat Completions error chunk). Nothing after the terminal
event is read: a connection that breaks or a proxy that keeps it open afterwards changes nothing.
A stream that ends before it fails the call, after what it streamed, with `ModelStreamIncompleteError`
from `flexharness-models`, so an OpenAI-compatible server that never sends `[DONE]` fails every
streamed call. `/ollama` ends an answer at its `done` object the same way. `/google`, `/groq`,
`/mistral`, `/xai` and `/perplexity` leave the stream to their AI SDK models, which read it to the
end of the connection.

Explicit settings win completely. A model adapter given no key takes the vendor's key
variable, such as `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`, and nothing else from the
environment. A model adapter given a key, a `baseUrl` or a `connection` uses it as given: no
variable adds a credential, header, organization or project beside it, so a set `ANTHROPIC_AUTH_TOKEN`,
`ANTHROPIC_CUSTOM_HEADERS`, `OPENAI_ORG_ID`, `OPENAI_PROJECT_ID` or `OPENAI_CUSTOM_HEADERS`
changes nothing. A connection that names no address calls the vendor's API, and one that
names no key authenticates its own way, with an `authToken`, `headers` or `fetch`; it never
takes the key variable. `/research` and the OpenAI helpers of `/media` send the key they are
given and no `ANTHROPIC_AUTH_TOKEN`, `OPENAI_ORG_ID` or `OPENAI_PROJECT_ID`, but their vendor
SDKs still add the headers that `ANTHROPIC_CUSTOM_HEADERS` or `OPENAI_CUSTOM_HEADERS` name:
those SDKs read them unconditionally.

Provider SDKs are installed together. Authentication, file access and vendor media
are separate entrypoints and are not imported by the provider factory root. For
ChatGPT authentication, pass
`connection: createOpenAiChatGptModelConnection(credentials)` from `/auth` to the
OpenAI model options. Delegated runtimes use
`createOpenAiChatGptDynamicModelConnection({ expectedIdentity, resolveAccess })`
instead; it resolves current access at every provider HTTP request while keeping
account and residency identity fixed for the connection. API-key inference
needs no authentication setup.

When an account authority such as authswitch owns the login, `/openai` runs
ChatGPT inference from access alone:
`createOpenAiChatGptResolvingModelConnection({ expectedIdentity, resolveAccess })`
resolves the access token, workspace and residency before every provider request
and resolves once more after a rejected token, and `listOpenAiChatGptModels()`
reads the model catalog with the same access. Neither parses the token; see
`openai/readme.md`.

HTTP gateways can normalize already serialized Responses JSON with
`normalizeOpenAiChatGptResponsesRequest(body)` from `/openai` before using the
resolving connection's authenticated `settings.fetch`. It hoists leading
system/developer text when `instructions` is absent, preserves explicitly supplied
instructions (including empty or null), keeps later instructions in order as
developer messages, and removes unsupported cache retention and output limits
without mutating the input. See `openai/readme.md` for the request boundary.

The package includes the applicable OpenAI Codex license and third-party notices.

## License and Legal Information

This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the repository license file.

**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.

### Trademarks

This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.

Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.

### Company Information

Task Venture Capital GmbH<br>
Registered at District Court Bremen HRB 35230 HB, Germany

For any legal inquiries or further information, please contact us via email at hello@task.vc.

By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
