supermemoryai/supermemory · error · Error

Responses API is not available in this OpenAI client version

Error message

Responses API is not available in this OpenAI client version

What it means

createResponsesWithMemory throws when the middleware was constructed against an OpenAI client that does not expose client.responses.create. The memory-enhanced Responses API path requires a sufficiently new openai npm package.

Source

Thrown at packages/tools/src/openai/middleware.ts:542

				: ""

		const memories = `${profileData}\n${searchResultsMemories}`.trim()

		if (memories) {
			logger.debug(`Memory content preview for ${context} API`, {
				content: memories,
				fullLength: memories.length,
			})
		}

		return memories
	}

	const createResponsesWithMemory = async (
		params: Parameters<typeof originalResponsesCreate>[0],
	) => {
		if (!originalResponsesCreate) {
			throw new Error(
				"Responses API is not available in this OpenAI client version",
			)
		}

		const input = typeof params.input === "string" ? params.input : ""

		if (mode !== "profile" && !input) {
			logger.debug("No input found for Responses API, skipping memory search")
			return originalResponsesCreate.call(openaiClient.responses, params)
		}

		logger.info("Starting memory search for Responses API", {
			containerTag,
			customId,
			mode,
		})

		const operations: Promise<unknown>[] = []

View on GitHub (pinned to d436792e77)

Solutions

  1. Upgrade the openai package to a version that includes the Responses API (v4.7x+ or v5+)
  2. Verify openai.responses.create exists on the raw client before wrapping
  3. Fall back to chat.completions.create if you cannot upgrade

Example fix

// before
const wrapped = withSupermemory(openai, opts)
await wrapped.responses.create({...}) // throws

// after
bun add openai@latest
const wrapped = withSupermemory(openai, opts)
await wrapped.responses.create({...})
Defensive patterns

Strategy: type-guard

Validate before calling

if (typeof openai.responses?.create !== 'function') { /* upgrade openai or use chat.completions instead */ }

Type guard

const hasResponsesApi = (c: unknown): c is { responses: { create: Function } } => !!(c as any)?.responses?.create

Try / catch

try { await wrapped.responses.create(p) } catch (e) { if (e instanceof Error && e.message.includes('not available')) { return await wrapped.chat.completions.create(toChatParams(p)) } throw e }

Prevention

When it happens

Trigger: Wrapping an older OpenAI client (pre-Responses API, roughly < openai v4.70) and then calling client.responses.create on the wrapped client.

Common situations: Upgrading @supermemory/tools but pinning an old openai version; bundlers tree-shaking the responses namespace; using a custom/mock client lacking the responses property.

Related errors


AI-assisted analysis of supermemoryai/supermemory@d436792e77 (2026-08-28). Data as JSON: /api/errors/ce7b05480236766e. Report an issue: GitHub.