OpenAI format
GET
/v1/models
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.mirapi.ai/v1/models"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "") req.Header.Add("anthropic-version", "") req.Header.Add("x-goog-api-key", "") req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.mirapi.ai/v1/models';const options = { method: 'GET', headers: { 'x-api-key': '', 'anthropic-version': '', 'x-goog-api-key': '', Authorization: 'Bearer <token>' }};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.mirapi.ai/v1/models \ --header 'Authorization: Bearer <token>' \ --header 'anthropic-version: ' \ --header 'x-api-key: ' \ --header 'x-goog-api-key: 'Returns the list of models currently available.
The response format is detected automatically from the request headers:
x-api-keytogether withanthropic-version→ Anthropic format- the
x-goog-api-keyheader or thekeyquery parameter → Gemini format - otherwise → OpenAI format
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”key
string
Google API key (for the Gemini format)
Header Parameters
Section titled “Header Parameters”x-api-key
string
Anthropic API key (for the Claude format)
Example
anthropic-version
string
Anthropic API version
Example
x-goog-api-key
string
Google API key (for the Gemini format)
Example
Responses
Section titled “Responses”Model list returned
Media typeapplication/json
object
object
string
data
Array<object>
object
id
Model ID
string
object
Object type
string
created
Creation timestamp
integer
owned_by
Model owner
string
Example
{ "object": "list", "data": [ { "id": "gpt-4", "object": "model", "owned_by": "openai" } ]}Authentication failed
Media typeapplication/json
object
error
object
message
Error message
string
type
Error type
string
param
Related parameter
string
code
Error code
string
Examplegenerated
{ "error": { "message": "example", "type": "example", "param": "example", "code": "example" }}