SendChatCompletionRequestRequest - Go SDK

SendChatCompletionRequestRequest type definition

The Go SDK and docs are currently in beta. Report issues on GitHub.

Fields

FieldTypeRequiredDescriptionExample
XOpenRouterMetadata*components.MetadataLevelOpt-in to surface routing metadata on the response under openrouter_metadata. Defaults to disabled. The legacy header X-OpenRouter-Experimental-Metadata is also accepted for backward compatibility.enabled
ChatRequestcomponents.ChatRequest✔️N/A{"max_tokens": 150,"messages": [{"content": "You are a helpful assistant.","role": "system"},
{"content": "What is the capital of France?","role": "user"}
],
“model”: “openai/gpt-4”,
“temperature”: 0.7
}