Create a message using the Anthropic Messages API shape.

post/messages

Request

  • Base URL
    https://api.electronhub.ai/v1
  • URL
    https://api.electronhub.ai/v1/messages
  • Auth
    HTTP bearer

Request body

modelstring required

Model ID

max_tokensinteger

Maximum tokens to generate

temperaturenumber
top_pnumber
top_kinteger
streamboolean
reasoning_effort'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh'

Ignored for models that do not support reasoning_effort

betasstring[]
context_managementobject
output_configobject
metadataobject

Example request

{
  "model": "claude-sonnet-4-5-20250929",
  "messages": [
    {
      "content": [
        {
          "source": {
            "media_type": "image/jpeg"
          }
        }
      ]
    }
  ]
}

Response

Success

idstring required
type'message' required
role'assistant' required
modelstring required
stop_reason'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' nullable required
stop_sequencestring nullable

Example response

{
  "content": [
    {
      "source": {
        "media_type": "image/jpeg"
      }
    }
  ]
}

Changes

    • breaking

      removed subschema #1 subschema #2 from the request property oneOf list

    • breaking

      the request property type changed from object to no type

    • breaking

      added to the / response property oneOf list for the response status

    • warning

      removed the request property /

    • warning

      removed the request property /

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      the request property // became optional

    • info

      added the new system enum value to the request property //

    • info

      request property list-of-types was widened by adding types array to media type application/json

    • info

      added to the //// request property oneOf list

    • info

      added subschema #1 subschema #2 to the request property oneOf list

    • info

      added subschema #1 subschema #2 to the request property oneOf list