We still don't have any documentation and things are in flux, but you can report your OpenAI API calls to OpenPipe now.
134 lines
4.5 KiB
JSON
134 lines
4.5 KiB
JSON
{
|
|
"openapi": "3.0.3",
|
|
"info": {
|
|
"title": "OpenPipe API",
|
|
"description": "The public API for reporting API calls to OpenPipe",
|
|
"version": "0.1.0"
|
|
},
|
|
"servers": [{ "url": "https://app.openpipe.ai/api" }],
|
|
"paths": {
|
|
"/v1/check-cache": {
|
|
"post": {
|
|
"operationId": "externalApi-checkCache",
|
|
"description": "Check if a prompt is cached",
|
|
"security": [{ "Authorization": [] }],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"startTime": {
|
|
"type": "number",
|
|
"description": "Unix timestamp in milliseconds"
|
|
},
|
|
"reqPayload": { "description": "JSON-encoded request payload" },
|
|
"tags": {
|
|
"type": "object",
|
|
"additionalProperties": { "type": "string" },
|
|
"description": "Extra tags to attach to the call for filtering. Eg { \"userId\": \"123\", \"promptId\": \"populate-title\" }"
|
|
}
|
|
},
|
|
"required": ["startTime"],
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"respPayload": { "description": "JSON-encoded response payload" }
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": { "$ref": "#/components/responses/error" }
|
|
}
|
|
}
|
|
},
|
|
"/v1/report": {
|
|
"post": {
|
|
"operationId": "externalApi-report",
|
|
"description": "Report an API call",
|
|
"security": [{ "Authorization": [] }],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"startTime": {
|
|
"type": "number",
|
|
"description": "Unix timestamp in milliseconds"
|
|
},
|
|
"endTime": { "type": "number", "description": "Unix timestamp in milliseconds" },
|
|
"reqPayload": { "description": "JSON-encoded request payload" },
|
|
"respPayload": { "description": "JSON-encoded response payload" },
|
|
"respStatus": { "type": "number", "description": "HTTP status code of response" },
|
|
"error": { "type": "string", "description": "User-friendly error message" },
|
|
"tags": {
|
|
"type": "object",
|
|
"additionalProperties": { "type": "string" },
|
|
"description": "Extra tags to attach to the call for filtering. Eg { \"userId\": \"123\", \"promptId\": \"populate-title\" }"
|
|
}
|
|
},
|
|
"required": ["startTime", "endTime"],
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful response",
|
|
"content": { "application/json": { "schema": {} } }
|
|
},
|
|
"default": { "$ref": "#/components/responses/error" }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"securitySchemes": { "Authorization": { "type": "http", "scheme": "bearer" } },
|
|
"responses": {
|
|
"error": {
|
|
"description": "Error response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": { "type": "string" },
|
|
"code": { "type": "string" },
|
|
"issues": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": { "message": { "type": "string" } },
|
|
"required": ["message"],
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
},
|
|
"required": ["message", "code"],
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|