OpenAI Format
Retrieve basic information for a specific model.
Try It
GET
/v1/models/{model}https://api-platform.ope.aiAuthentication
Use Bearer token authentication.
- Header:
Authorization: Bearer <api-key> - Example:
Authorization: Bearer sk-xxxxxx
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID |
Request Examples
- cURL
- JavaScript
- Python
curl -X GET "https://api-platform.ope.ai/v1/models/{model}" \
-H "Authorization: Bearer $OPEAI_API_KEY"
const model = "gpt-4";
const res = await fetch(`https://api-platform.ope.ai/v1/models/${encodeURIComponent(model)}`, {
headers: {Authorization: `Bearer ${process.env.OPEAI_API_KEY}`},
});
console.log(await res.json());
import os
import requests
resp = requests.get(
"https://api-platform.ope.ai/v1/models/gpt-4",
headers={"Authorization": f"Bearer {os.environ['OPEAI_API_KEY']}"},
timeout=60,
)
print(resp.json())
Response Example
- Success
- Model not found
{
"id": "gpt-4",
"object": "model",
"created": 1687882411,
"owned_by": "openai"
}
When the model does not exist, the backend returns HTTP 200 with an error object in the response body.
{
"error": {
"message": "The model 'unknown-model' does not exist",
"type": "invalid_request_error",
"param": "model",
"code": "model_not_found"
}
}