Messages

Create a message

POST
/v1/messages

Claude-native Messages format, used by the Anthropic SDK and Claude Code. Authenticate with Authorization: Bearer <Key> or x-api-key: <Key>. max_tokens is required.

Works with models that support the Claude-native format; the endpoints each model supports are listed on the model square.

With the Anthropic SDK, set the base URL to https://ai.myaiexp.com without /v1.

Authorization

BearerAuth
headerAuthorizationBearer <token>

Authenticate with an API key. Format: Authorization: Bearer sk-xxxxxx. Create keys on the API Keys page of the console (https://ai.myaiexp.com/keys).

Header Parameters

anthropic-version*string

Anthropic API version

x-api-key?string

You can pass the key in x-api-key instead of Bearer auth

Request Body

application/json
  1. body
model*string

Model ID, for example your-model-id. Replace it with a model ID from the model square (https://ai.myaiexp.com/pricing), or call GET /v1/models to list the models your key can use.

messages*array<>
system?string|array<>
max_tokens*integer
Range1 <= value
temperature?number
Range0 <= value <= 1
top_p?number
top_k?integer
stream?boolean
stop_sequences?array<string>
tools?array<>
tool_choice?
thinking?
metadata?

Response Body

Response created

application/json
  1. response
id?string
type?string
role?string
content?array<>
model?string
stop_reason?string
Value in"end_turn""max_tokens""stop_sequence""tool_use"
usage?
Example Request
curl -X POST 'https://ai.myaiexp.com/v1/messages' \  -H 'anthropic-version: 2023-06-01' \  -H 'Content-Type: application/json' \  -d '{  "model": "your-model-id",  "max_tokens": 1024,  "messages": [    {      "role": "user",      "content": "Introduce yourself in one sentence"    }  ]}'
Example Response
{  "id": "msg_011CfngP3hfcodU3AZYA2WHX",  "type": "message",  "role": "assistant",  "model": "your-model-id",  "content": [    {      "type": "text",      "text": "I'm an AI assistant."    }  ],  "stop_reason": "end_turn",  "usage": {    "input_tokens": 14,    "output_tokens": 20  }}

This service is provided for learning and research purposes only. Please follow each model provider's usage policies.