APIs for sampling from and fine-tuning language models
Bring your own key. This API needs your own OpenAI API key - get one from the provider, add it once below, and the proxy injects it on every call. Your OmniStream plan covers the unified SDK, key storage, and proxy - the provider's own rate limits still apply to your key.
This is a community listing. If you own this API, you can request ownership.
npm install omnistream-sdkimport { OmniClient } from "omnistream-sdk";
const omni = new OmniClient({ token: process.env.OMNI_KEY! });
// One key reaches every API on the marketplace.
const data = await omni.call("openai/createTranscription");One install, one key - the same client calls every API on the marketplace.
Transcribes audio into the input language.
Translates audio into into English.
Creates a completion for the chat message
Creates a completion for the provided prompt and parameters
Creates a new edit for the provided input, instruction, and parameters.
Creates an embedding vector representing the input text.
Returns a list of files that belong to the user's organization.
Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
/**
* OpenAIAPI - generated by OmniStream from OpenAI API's OpenAPI spec.
* One typed method per endpoint. A single Omni key reaches the API.
*/
const DEFAULT_BASE = "https://grid.skinvaults.online/v1/proxy/openai";
export class OpenAIAPIError extends Error {
status: number;
code?: string;
constructor(status: number, code: string | undefined, message?: string) {
super(message || `OpenAIAPI error ${status}`);
this.name = "OpenAIAPIError";
this.status = status;
this.code = code;
}
}
export interface OpenAIAPIOptions {
baseUrl?: string;
fetch?: typeof fetch;
timeoutMs?: number;
}
export class OpenAIAPI {
/** @param token Your OmniStream key (one key for every API). */
constructor(private token: string, private opts: OpenAIAPIOptions = {}) {
if (!token) throw new Error("OpenAIAPI: token is required");
}
rateLimit: { remainingMinute?: number; remainingDay?: number } | null = null;
private async _request(method: string, path: string, { params, body }: { params?: Record<string, unknown>; body?: unknown } = {}): Promise<any> {
const f = this.opts.fetch ?? globalThis.fetch;
const url = new URL((this.opts.baseUrl ?? DEFAULT_BASE).replace(/\/+$/, "") + path);
if (params) for (const [k, v] of Object.entries(params)) if (v != null) url.searchParams.set(k, String(v));
const headers: Record<string, string> = { "x-omni-key": this.token };
if (body !== undefined) headers["content-type"] = "application/json";
const res = await f(url, { method, headers, body: body !== undefined ? JSON.stringify(body) : undefined });
this.rateLimit = {
remainingMinute: Number(res.headers.get("x-ratelimit-remaining-minute")) || undefined,
remainingDay: Number(res.headers.get("x-ratelimit-remaining-day")) || undefined,
};
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new OpenAIAPIError(res.status, data?.error?.code, data?.error?.message);
return data.data ?? data;
}
/** Transcribes audio into the input language. */
createTranscription(): Promise<any> {
return this._request("POST", "/audio/transcriptions", { });
}
/** Translates audio into into English. */
createTranslation(): Promise<any> {
return this._request("POST", "/audio/translations", { });
}
/** Creates a completion for the chat message */
createChatCompletion(body: unknown): Promise<any> {
return this._request("POST", "/chat/completions", { body });
}
/** Creates a completion for the provided prompt and parameters */
createCompletion(body: unknown): Promise<any> {
return this._request("POST", "/completions", { body });
}
/** Creates a new edit for the provided input, instruction, and parameters. */
createEdit(body: unknown): Promise<any> {
return this._request("POST", "/edits", { body });
}
/** Creates an embedding vector representing the input text. */
createEmbedding(body: unknown): Promise<any> {
return this._request("POST", "/embeddings", { body });
}
/** Returns a list of files that belong to the user's organization. */
listFiles(): Promise<any> {
return this._request("GET", "/files", {});
}
/** Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
*/
createFile(): Promise<any> {
return this._request("POST", "/files", { });
}
/** Returns information about a specific file. */
retrieveFile(params: { "file_id": string }): Promise<any> {
return this._request("GET", "/files/{file_id}", { params });
}
/** Delete a file. */
deleteFile(params: { "file_id": string }): Promise<any> {
return this._request("DELETE", "/files/{file_id}", { params });
}
/** Returns the contents of the specified file */
downloadFile(params: { "file_id": string }): Promise<any> {
return this._request("GET", "/files/{file_id}/content", { params });
}
/** List your organization's fine-tuning jobs
*/
listFineTunes(): Promise<any> {
return this._request("GET", "/fine-tunes", {});
}
/** Creates a job that fine-tunes a specified model from a given dataset.
Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
[Learn more about Fine-tuning](/docs/guides/fine-tuning)
*/
createFineTune(body: unknown): Promise<any> {
return this._request("POST", "/fine-tunes", { body });
}
/** Gets info about the fine-tune job.
[Learn more about Fine-tuning](/docs/guides/fine-tuning)
*/
retrieveFineTune(params: { "fine_tune_id": string }): Promise<any> {
return this._request("GET", "/fine-tunes/{fine_tune_id}", { params });
}
/** Immediately cancel a fine-tune job.
*/
cancelFineTune(params: { "fine_tune_id": string }): Promise<any> {
return this._request("POST", "/fine-tunes/{fine_tune_id}/cancel", { params });
}
/** Get fine-grained status updates for a fine-tune job.
*/
listFineTuneEvents(params: { "fine_tune_id": string; "stream"?: boolean }): Promise<any> {
return this._request("GET", "/fine-tunes/{fine_tune_id}/events", { params });
}
/** Creates an edited or extended image given an original image and a prompt. */
createImageEdit(): Promise<any> {
return this._request("POST", "/images/edits", { });
}
/** Creates an image given a prompt. */
createImage(body: unknown): Promise<any> {
return this._request("POST", "/images/generations", { body });
}
/** Creates a variation of a given image. */
createImageVariation(): Promise<any> {
return this._request("POST", "/images/variations", { });
}
/** Lists the currently available models, and provides basic information about each one such as the owner and availability. */
listModels(): Promise<any> {
return this._request("GET", "/models", {});
}
/** Retrieves a model instance, providing basic information about the model such as the owner and permissioning. */
retrieveModel(params: { "model": string }): Promise<any> {
return this._request("GET", "/models/{model}", { params });
}
/** Delete a fine-tuned model. You must have the Owner role in your organization. */
deleteModel(params: { "model": string }): Promise<any> {
return this._request("DELETE", "/models/{model}", { params });
}
/** Classifies if text violates OpenAI's Content Policy */
createModeration(body: unknown): Promise<any> {
return this._request("POST", "/moderations", { body });
}
}
export default OpenAIAPI;
No reviews yet. Be the first to rate this API.
Yes. OpenAI API uses bearer authentication, so you bring your own key from the provider. You store it once on OmniStream and the proxy injects it into every call, so your code only ever sends your Omni key.
APIs for sampling from and fine-tuning language models It exposes 23 endpoints over POST, GET, DELETE, including POST /audio/transcriptions, POST /audio/translations, POST /chat/completions.
Install the OmniStream SDK for your language and call OpenAI API through it. The client is generated from this API's OpenAPI spec, so parameters and responses are fully typed, and the same client also calls every other API in the marketplace.
You can start on the free plan. OmniStream charges for the unified SDK, key storage and proxy rather than for OpenAI API itself, and OpenAI API's own rate limits still apply to your provider key.
UnoRouter: AI model gateway: one OpenAI-compatible endpoint that routes to many model providers, with usage metering and billing built in.
Returns information about a specific file.
Delete a file.
Returns the contents of the specified file
List your organization's fine-tuning jobs
Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
Immediately cancel a fine-tune job.
Get fine-grained status updates for a fine-tune job.
Creates an edited or extended image given an original image and a prompt.
Creates an image given a prompt.
Creates a variation of a given image.
Lists the currently available models, and provides basic information about each one such as the owner and availability.
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
Delete a fine-tuned model. You must have the Owner role in your organization.
Classifies if text violates OpenAI's Content Policy