Modern PetstoreAPI Docs
HomeGuidesModern PetstoreAPI
Classic PetstoreAPI
HomeGuidesModern PetstoreAPI
Classic PetstoreAPI
  1. Chat
  • Pet
    • Get Pet
      GET
    • Update Pet
      PUT
    • Delete Pet
      DELETE
    • Create Pet
      POST
    • List Pets
      GET
    • Upload Pet Image
      POST
  • Chat
    • Pet Care AI Consultation
      POST
  • Payments
    • Pay Order
      POST
  • Store
    • Get Store Inventory
      GET
    • List Inventory
      GET
    • Create Order
      POST
    • Get Order
      GET
    • Cancel Order
      DELETE
    • Callback Example
      POST
  • User
    • Create User
      POST
    • Update User
      PUT
    • Get User
      GET
    • Delete User Account
      DELETE
    • Create Authentication Token
      POST
  • Webhooks
    • Order Status Changed Event
    • Payment Succeeded Event
  • Schemas
    • Pet
    • PetCollection
    • User
    • OrderPayment
    • Bank Card
    • Bank Account
    • Category
    • Links
    • Order
    • ApiResponse
    • Tag
    • Error
HomeGuidesModern PetstoreAPI
Classic PetstoreAPI
HomeGuidesModern PetstoreAPI
Classic PetstoreAPI
  1. Chat

Pet Care AI Consultation

POST
https://api.petstoreapi.com/v1/chat/completions
AI-powered consultation service for pet care questions and advice. This endpoint provides expert guidance on pet health, behavior, nutrition, training, and general care through an intelligent conversational interface. Supports streaming responses using Server-Sent Events (SSE) for real-time interaction.

OpenAI API Compatibility#

This endpoint follows the OpenAI Chat Completions API specification, which has become the de facto industry standard for chat-based AI interactions. By maintaining compatibility with OpenAI's API design, this endpoint ensures:
Seamless integration with existing OpenAI-compatible SDKs and tools
Familiar developer experience for those already using OpenAI APIs
Easy migration path for applications built on OpenAI's platform
Note: Some field names (e.g., created instead of createdAt) intentionally differ from this API's naming conventions to maintain full OpenAI compatibility.

Pet Care Expert AI#

Our AI consultation service helps pet owners with:
Health & Wellness: Symptom assessment, vaccination schedules, preventive care advice
Nutrition: Diet recommendations, feeding schedules, food allergies and sensitivities
Behavior & Training: Behavioral issues, training techniques, socialization tips
Breed Information: Breed-specific care requirements, temperament, compatibility
Adoption Guidance: Choosing the right pet, preparation for new pets, adoption process
Emergency Guidance: First aid advice, when to see a vet, urgent care situations
Disclaimer: This AI provides general guidance only and does not replace professional veterinary care. Always consult a licensed veterinarian for medical diagnosis and treatment.

Streaming Mode#

When stream: true, the response is sent as Server-Sent Events (SSE), with each token delivered incrementally. This provides a better user experience for longer responses.

Stream Format#

Each chunk is sent as:
data: {"id":"chatcmpl_abc","object":"chat.completion.chunk","choices":[{"delta":{"content":"Hello"},"index":0}]}
The stream ends with:
data: [DONE]

Non-Streaming Mode#

When stream: false or omitted, returns a complete response object.

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
OAuth 2.0
Authorization Code
deviceCode
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Authorize URL: https://auth.petstoreapi.com/authorize
Token URL: https://auth.petstoreapi.com/token
Refresh URL: https://auth.petstoreapi.com/refresh
Scopes:
chat:write-Access AI chat completions
or
Header Params

Body Params application/jsonRequired

Examples

Responses

🟢201Created
application/json
Successful response. Format depends on the stream parameter.
Headers

Body

Request Request Example
Shell
JavaScript
Java
Swift
cURL (Non-Streaming)
curl -X POST 'https://api.petstoreapi.com/v1/chat/completions' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "What should I know before adopting a cat?"
      }
    ],
    "model": "pet-advisor-1",
    "stream": false
  }'
Response Response Example
{
    "id": "chatcmpl_abc123",
    "object": "chat.completion",
    "created": 1702648800,
    "model": "pet-advisor-1",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "Before adopting a cat, consider these important factors:\n\n1. **Time Commitment**: Cats can live 15-20 years\n2. **Space**: Ensure you have adequate living space\n3. **Allergies**: Check if anyone in your household has cat allergies\n4. **Costs**: Budget for food, litter, vet care, and supplies\n5. **Lifestyle**: Consider if your schedule allows for proper care\n\nWould you like recommendations for cats currently available for adoption?"
            },
            "finishReason": "stop"
        }
    ],
    "usage": {
        "promptTokens": 15,
        "completionTokens": 89,
        "totalTokens": 104
    }
}
Modified at 2026-01-07 06:44:25
Previous
Upload Pet Image
Next
Pay Order
Built with