OpenAI Proxy

 1---
 2# Passthrough access to the OpenAI API, with the platform's API key.
 3# Use the OpenAI SDK, with this Proxy's URL as its base_url and a Smarter API key as its api_key:
 4#
 5#   client = OpenAI(base_url="https://<smarter>/api/v1/proxy/openai/", api_key="<Smarter API key>")
 6#
 7# Only the inference endpoints are allowed, so that the platform's OpenAI organization's
 8# files, fine-tuning jobs, batches and settings cannot be reached through it.
 9apiVersion: smarter.sh/v1
10kind: Proxy
11metadata:
12  name: openai
13  description: Passthrough access to the OpenAI API's chat completions, responses, embeddings and models.
14  version: 1.0.0
15  tags:
16    - openai
17    - builtin
18  annotations:
19    - smarter.sh/proxy/builtin: "true"
20    - smarter.sh/proxy/documentation: https://platform.openai.com/docs/api-reference
21spec:
22  provider: openai
23  apiKey: openai_api_key
24  baseUrl: https://api.openai.com/v1/
25  auth:
26    header: Authorization
27    scheme: Bearer
28  allowedPaths:
29    - chat/completions
30    - completions
31    - responses
32    - embeddings
33    - moderations
34    - models
35    - models/*
36  timeout: 120
37  isActive: true