MORPHWARE
HomeAboutRoadmapTelegramTwitterWebsite
  • ๐Ÿ‘‹Morphware Documents
    • ๐ŸงฎAbstract
    • โ›“๏ธWeb3 Client Acquisition
    • ๐ŸญIndustry Specific Solutions
    • ๐Ÿ—ƒ๏ธCompetitive Analysis
    • โ˜๏ธCloud Compute and API Integration
    • ๐Ÿง AI and Machine Learning Solutions
  • โš™๏ธAPI Docs
    • Credits
    • Pricing
    • Chat Completion
    • Ollama Embeddings
    • Image Generation
  • Overview
    • ๐Ÿ‘ฉโ€๐ŸซIntroduction
    • ๐Ÿ‘ฅTeam
    • ๐Ÿ—บ๏ธRoadmap
  • solutions
    • โ“Problem
    • ๐Ÿ”ฅSolution
  • economy
    • ๐Ÿช™Tokenomics
  • Legal
    • ๐ŸŽฉPotential
    • ๐Ÿ›ก๏ธGovernance and Community Engagement
  • Others
    • ๐Ÿ“Conclusion
  • community
    • ๐ŸŒWebsite
    • ๐ŸŒ Telegram
    • โœ–๏ธTwitter
    • ๐Ÿ“บTiktok
    • ๐Ÿ“ฑInstagram
    • ๐Ÿ‘€Discord
    • ๐Ÿ’ฌProduct
Powered by GitBook
On this page
  1. API Docs

Chat Completion

PreviousPricingNextOllama Embeddings

Last updated 1 month ago

: Required (JWT token or Api Key)

โš™๏ธ
Authentication

Generate Chat Completion

post

Generates a chat completion response using the specified model. Requires sufficient user credits and valid model.

Authorizations
Body
modelstringRequired

ID of the model to use for completion

streambooleanOptional

Whether to stream back partial progress

Default: false
temperaturenumber ยท floatOptional

What sampling temperature to use, between 0 and 2

Default: 1
top_pnumber ยท floatOptional

An alternative to sampling with temperature, called nucleus sampling

Default: 1
max_tokensintegerOptional

The maximum number of tokens to generate in the completion

seedintegerOptional

Seed for deterministic results

max_completion_tokensintegerOptional

Maximum number of completion tokens

frequency_penaltynumber ยท floatOptional

Number between -2.0 and 2.0 to penalize repeated tokens

Default: 0
presence_penaltynumber ยท floatOptional

Number between -2.0 and 2.0 to penalize tokens already present in the text

Default: 0
Responses
200
Successfully generated completion
application/json
402
Insufficient credits
application/json
403
Model access forbidden
application/json
404
Model not found
application/json
post
curl -X POST "https://app.morphware.com/api/chat/completions" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \ 
  -d '{
    "model": "llama3.3:70b-instruct-q8_0",
    "messages": [
      {"role": "user", "content": "Hello, can you help me with a coding problem?"}
    ]
  }'
{
  "usage": {
    "prompt_tokens": 24,
    "completion_tokens": 42,
    "total_tokens": 66
  },
  "choices": {
    "id": "chat-12345abcde",
    "created": 1707841963,
    "model": "llama3.3:70b-instruct-q8_0",
    "choices": [
      {
        "index": 0,
        "logprobs": null,
        "finish_reason": "stop",
        "message": {
          "content": "I'd be happy to help with your coding problem. Could you please describe the issue you're facing in more detail? What programming language are you working with, and what specific problem are you trying to solve?",
          "role": "assistant"
        }
      }
    ],
    "object": "chat.completion"
  }
}