Claude Messages Compatible Endpoint
curl --request POST \
--url https://api.freemodel.app/v1/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.freemodel.app/v1/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.freemodel.app/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.freemodel.app/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.freemodel.app/v1/messages"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.freemodel.app/v1/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.freemodel.app/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyEndpoint Reference
Claude Messages Compatible Endpoint
Technical reference for FreeModel’s Anthropic Claude Messages-compatible endpoint at POST /v1/messages.
POST
/
v1
/
messages
Claude Messages Compatible Endpoint
curl --request POST \
--url https://api.freemodel.app/v1/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.freemodel.app/v1/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.freemodel.app/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.freemodel.app/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.freemodel.app/v1/messages"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.freemodel.app/v1/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.freemodel.app/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyFreeModel exposes an Anthropic Claude Messages-compatible endpoint at
Base URL for Anthropic-compatible clients is
A successful response has
POST /v1/messages. Use this page for request shape, headers, and response fields.
Looking for product setup (Claude Code, env vars, /status checks)? See the Claude Code integration guide.
Endpoint
POST https://api.freemodel.app/v1/messages
https://api.freemodel.app (no /v1 suffix on the base when the client appends /v1/messages).
Authentication and headers
| Header | Required | Notes |
|---|---|---|
Authorization: Bearer sk-... | Yes | FreeModel API key |
anthropic-version | Recommended | e.g. 2023-06-01 |
content-type | Yes | application/json |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | A text model ID available to your key (for example gpt-5.4-mini) |
messages | array | Yes | Anthropic-style message list (role + content) |
max_tokens | integer | Yes | Cap on generated tokens |
stream | boolean | No | Server-sent events when true |
system | string | No | System prompt when supported by the client |
curl example
curl https://api.freemodel.app/v1/messages \
-H "Authorization: Bearer $FREEMODEL_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "gpt-5.4-mini",
"max_tokens": 64,
"messages": [{"role": "user", "content": "Reply with OK."}]
}'
type: "message" and assistant text under content[0].text (or the equivalent content blocks your client expects).
Choosing a model
CallGET /v1/models and pick a text model ID. FreeModel converts Claude Messages requests to the selected model’s serving protocol. Current GPT catalog pages (for example GPT-5.6) list prices per 1M tokens.
Related
| Need | Page |
|---|---|
| Claude Code install, env vars, troubleshooting | Claude Code integration |
| OpenAI Chat Completions protocol | Chat Completions |
| Error codes | Errors |
Navigation queries such as “freemodel claude” should land on the
Claude Code integration. This page is the
technical endpoint reference only.