MCPcopy
hub / github.com/NitroRCr/AIaW / openaiGetModelList

Function openaiGetModelList

src/utils/values.ts:33–41  ·  view source on GitHub ↗
({ baseURL, apiKey })

Source from the content-addressed store, hash-verified

31 apiKey: String({ title: 'API Key', format: 'password' })
32}
33async function openaiGetModelList({ baseURL, apiKey }) {
34 const resp = await fetch(`${baseURL}/models`, {
35 headers: {
36 Authorization: `Bearer ${apiKey}`
37 }
38 })
39 const { data } = await resp.json()
40 return data.map(m => m.id)
41}
42const ProviderTypes: ProviderType[] = [
43 {
44 name: 'openai',

Callers 1

values.tsFile · 0.85

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected